Hi, I try to change data from a combobox dynamically.
I got a object containing a javascrip array (Module.Collection)
I create the combobox like:
Then when the user click on a button, I call this function:
The collection object grow, but the combobox do not reflec change wih the dataSource.Read();
Any idea?
Thanks a lot.
I got a object containing a javascrip array (Module.Collection)
I create the combobox like:
$(
"#cboListe"
).kendoComboBox({
dataTextField:
"Nom"
,
dataValueField:
"Id"
,
dataSource: Module.Collection,
filter:
"contains"
,
suggest:
true
,
index: 1,
});
Then when the user click on a button, I call this function:
this
.AddItemColl =
function
() {
Item =
new
ObjetA();
Item.Id =
this
.Collection.length + 1;
Item.Nom =
"Nom"
+ (
this
.Collection.length + 1);
this
.Collection.push(Item);
var
combobox = $(
"#cboListe"
).data(
"kendoComboBox"
);
combobox.dataSource.read();
}
The collection object grow, but the combobox do not reflec change wih the dataSource.Read();
Any idea?
Thanks a lot.