dijit.form.ComboBox
Dojo Toolkit 1.7.1
It's impossible now to refresh a store of a combobox through assigning new store object to the "store" attribute. But you can use this simple solution:
var myComboBox = {};
function fReloadDataToComboBox()
{
if(myComboBox)
{
myComboBox.destroyRecursive(false);
}
var myStore = new dojo.data.ItemFileReadStore({
url: "myService"
});
myComboBox = new dijit.form.ComboBox({
id: "myComboBox",
name: "my_name",
store: myStore,
searchAttr: "name",
onChange: fOnChangeComboBox
});
dojo.place(myComboBox.domNode, dojo.byId("myDiv"));
}
Dojo Toolkit 1.7.1
It's impossible now to refresh a store of a combobox through assigning new store object to the "store" attribute. But you can use this simple solution:
var myComboBox = {};
function fReloadDataToComboBox()
{
if(myComboBox)
{
myComboBox.destroyRecursive(false);
}
var myStore = new dojo.data.ItemFileReadStore({
url: "myService"
});
myComboBox = new dijit.form.ComboBox({
id: "myComboBox",
name: "my_name",
store: myStore,
searchAttr: "name",
onChange: fOnChangeComboBox
});
dojo.place(myComboBox.domNode, dojo.byId("myDiv"));
}
Brak komentarzy:
Prześlij komentarz