Hi All,
I am attempting to use Fetch in a change event for a combobox to update another combobox. Read works fine for the 2nd combobox's collection but when using fetch the data object for the second datasource does NOT update.
$("#comboOne").width(180).kendoComboBox({
autoBind: false,
dataTextField: "Name",
dataValueField: "Id",
dataSource: dsComboOne,
change: function (e) {
//dsComboTwo.read();
dsComboTwo.fetch(function () {
if (dsComboOne.total() == 0) {
//do stuff to DOM
} else {
//do different stuff to DOM
}
});
$("#comboTwo").data("kendoComboBox").value(null);
$("#comboTwo").data("kendoComboBox").enable(true);
}
});
So calling dsComboTwo.read() works as expected. Calling dsComboTwo.fetch() does not actually update the dsComboTwo.data object. When i run a watch and break in the callback i can see the dsComboTwo.data is the same as the previous/initial call.
Is there some other way to do this? Callback on the datasource i am missing? The success: callback in the DS also does not seem to work. No error.. just does not fire. Same with the change: . Can someone clarify this with an example? I've seen variations of this question elsewhere.
I am attempting to use Fetch in a change event for a combobox to update another combobox. Read works fine for the 2nd combobox's collection but when using fetch the data object for the second datasource does NOT update.
$("#comboOne").width(180).kendoComboBox({
autoBind: false,
dataTextField: "Name",
dataValueField: "Id",
dataSource: dsComboOne,
change: function (e) {
//dsComboTwo.read();
dsComboTwo.fetch(function () {
if (dsComboOne.total() == 0) {
//do stuff to DOM
} else {
//do different stuff to DOM
}
});
$("#comboTwo").data("kendoComboBox").value(null);
$("#comboTwo").data("kendoComboBox").enable(true);
}
});
So calling dsComboTwo.read() works as expected. Calling dsComboTwo.fetch() does not actually update the dsComboTwo.data object. When i run a watch and break in the callback i can see the dsComboTwo.data is the same as the previous/initial call.
Is there some other way to do this? Callback on the datasource i am missing? The success: callback in the DS also does not seem to work. No error.. just does not fire. Same with the change: . Can someone clarify this with an example? I've seen variations of this question elsewhere.