Jianfu Pan
2010-10-09 15:54:16 UTC
I'm implementing two filteringSelect list boxes linked to separate json data
stores. The first list comes from a fixed json data file, but the second
one is loaded with different data store based on the selection in the first
list. This setup works in initial loading (default selection). But when I
change the value of the first list, which then triggered the reload of the
second box, the second select box disappears entirely. Here is how I create
the second list box (the first list is created in the same way and I don't
have problem with that):
function load_second_list(json)
{
if(dijit.byId("secondSelectId")) {
dijit.byId("secondSelectId").destroyRecursive();
}
var store = new dojo.data.ItemFileReadStore({ url: json,
urlPreventCache: true, clearOnClose: true });
var onchange = function()
{
...
}
var select = new dijit.form.FilteringSelect(
{
id: "secondSelectId",
name: "secondSelectName",
value: "",
store: store,
searchAttr: "name",
onChange: onchange
},
"secondSelectDiv"
);
}
I appreciate very much if anyone could help.
Regards,
Jianfu Pan
stores. The first list comes from a fixed json data file, but the second
one is loaded with different data store based on the selection in the first
list. This setup works in initial loading (default selection). But when I
change the value of the first list, which then triggered the reload of the
second box, the second select box disappears entirely. Here is how I create
the second list box (the first list is created in the same way and I don't
have problem with that):
function load_second_list(json)
{
if(dijit.byId("secondSelectId")) {
dijit.byId("secondSelectId").destroyRecursive();
}
var store = new dojo.data.ItemFileReadStore({ url: json,
urlPreventCache: true, clearOnClose: true });
var onchange = function()
{
...
}
var select = new dijit.form.FilteringSelect(
{
id: "secondSelectId",
name: "secondSelectName",
value: "",
store: store,
searchAttr: "name",
onChange: onchange
},
"secondSelectDiv"
);
}
I appreciate very much if anyone could help.
Regards,
Jianfu Pan