回復 6#Programmer
in select-chain.php, it *imports/requires/includes* jQuery and the select-chain package when it is rendered in browsers to enable the magic.
You can then find the following JS code. It is the select-chain-package-controller.
You will need to configure it, set the target to fit your design.
<script type="text/javascript">
<!--
$(function () {
var cat = $('#categorySelect');
var el = $('#elementSelect');
var attr = $('#attributeSelect');
el.selectChain({
target: attr,
url: 'select-chain.php',
data: { ajax: true, anotherval: "anotherAction" }
});
// note that we're assigning in reverse order
// to allow the chaining change trigger to work
cat.selectChain({
target: el,
url: 'select-chain.php',
data: { ajax: true }
}).trigger('change');
});
//-->
</script>
複製代碼
By default, the remysharp jQuery module auto-populates the dynamic data using the HTML Select-Option tag.
If you want to display them as Table or whatever, you need to edit select-chain.js. The magic begins on line 31. Below is the code block to inject the dynamic data to the predefined "target" in controller.
success: function (j) {
var options = [], i = 0, o = null;
for (i = 0; i < j.length; i++) {
// required to get around IE bug (http://support.microsoft.com/?scid=kb%3Ben-us%3B276228)
回復 Programmer
in select-chain.php, it *imports/requires/includes* jQuery and the select-chain pa ...
kau 發表於 2010-11-25 14:12
Thank you
I have been try a day, finally I got a lot of error. one of that is "Object doesn't support this property or method" in php file. May I request again, Please tell me if you have simple example.