Releases: tuupola/jquery_chained
Legacy syntax removed
Legacy syntax was removed. Remote version accepts all options including url only as object.
$("#series").remoteChained({
parents : "#mark",
url : "/api/series.json"
});
Passed in JSON can now be array of objects.
[
{ "" : "--" },
{ "series-1" : "1 series" },
{ "series-3" : "3 series" },
{ "series-5" : "5 series" },
{ "series-6" : "6 series" },
{ "series-7" : "7 series" },
{ "selected" : "series-6" }
]
Chain to non select inputs
Parent can now be any input. For example text
or hidden
. If loading
has non falsy value clear
parameter optional and assumed to be true
.
$("#engine").remoteChained({
parents : "#engine, #model",
url : "/api/series.json",
loading : "Loading..."
});
Optionally clear child selects
Possibility to clear child selects before making JSON request. You can also optionally set loading text. This helps to avoid confusion with slower remote requests.
$("#engine").remoteChained({
parents : "#engine, #model",
url : "/api/series.json",
clear : true,
loading : "Loading..."
});
Trigger less change events
Code now uses a function instead of triggering change
event when initializing child selects. Also when updating child select change
event will not be triggered if child select value did not change.
Values is now called depends
Rename values
setting to more logical depends
.
Improved Bower support
Removed unneeded files when installing with Bower.
New syntax and bootstrapping
New alternate but prettier syntax for remote version. Allows you to pass all settings as one hash. Also adds support for bootstrapping selects by passing JSON data in settings. Bootstrapping is used to avoid making the initial AJAX call.
$("#series").remoteChained({
parents : "#mark",
url : "/api/series.json",
bootstrap : {
"--" : "--",
"series-3" : "3 series",
"series-5" : "5 series",
"series-6" : "6 series",
"selected" : "series-3"
}
});
Add possibility to optionally send additional values of non chained inputs when using remote version.
$("#transmission").remoteChained({
parents: "#engine",
url: "/api/transmissions.json",
values: "#model"
});
Support for Travis and Grunt.
Fix bug #12. Minified versions were missing trailing semicolon. Also support for Travis and Grunt.
Use name instead of id
Remote version now uses name
attribute instead id
when sending AJAX query.
Improved JSON support
JSON can now also be array of arrays. This enables you to sort items serverside. (Marco Mariani)