I have three components that work together to filter a KendoGrid and filter each other. Basically when DropDownA gets changed, it should clear any selected values of the MultiSelect, then filter the MultiSelect's dataSource. It works fine on the very first change event of DropDownA, but after that it clears the values from the MultiSelect (calling .value() on it returns []), but does not update the UI--any previously selected values will still be there. The Kendo Components do use server filtering. I've tried clearing the filter before setting the value, as well as setting the value to null, "", and []--all produce the same or similar behavior.
function
onChange() {
stationDropDown.select(-1);
hydrantGroupMultiSelect.value(
null
);
stationDropDown.dataSource.filter({}, {
branchGroupId: value
});
hydrantGroupMultiSelect.dataSource.filter({}, {
branchId:
""
,
branchGroupId: value
});
}
Above is the change event of DropDownA, and my multiSelects config:
$(
'#'
+ options.thisId).kendoMultiSelect({
value:
"None Selected"
,
dataSource:
// A Backbone DataSource wrapper we use,
dataTextField:
"id"
,
dataValueField:
"description"
,
filter:
"contains"
,
placeholder:
"None Selected"
,
change: _.bind(
function
(e) {
// Some Change Event code unrelated to this problem
},
this
)
});
Digging through the Kendo library code to see how the behavior changes between the two (first change event and subsequent change events) is that around line 31258 in kendo.all.js, listView.isFiltered() is set to false on first change event, and set to true on subsequent change events, which causes different behavior. If I remove the filtering on the multiSelect in the change event, the component behaves properly.
Any ideas?
Thanks