I have a question about the Column.Filterable.UI property. I have been experimenting with custom filtering by following this example http://dojo.telerik.com/EyoL/31, however it appears that the UI function only gets called once. Is this correct? What I am trying to do is limit the values displayed based on other filters applied. Below is a sample of my function.
01.function createMultiSelect(element, fieldName) {02. var isFilter = $("#grid").data("kendoGrid").dataSource.filter();03. var data = $("#grid").data("kendoGrid").dataSource;04. var ds = data.data();05. if (isFilter) {06. var query = new kendo.data.Query(ds);07. ds = query.filter(isFilter).data;08. }09. else {10. ds = data.data();11. }12. //var names = ds.sortBy(ds.uniq(ds.pluck(ds, "GroupCode")), function (n) { return n; });13. var names = _.sortBy(_.uniq(_.pluck(ds, fieldName)), function (n) { return n; });14. //mvvm binding should be removed, other way the dataSource will try to update the UI when the dataSource filter has changed15. element.removeAttr("data-bind");16. 17. element.kendoMultiSelect({18. dataSource: names,19. change: function (e) {20. var curFilter21. if (isFilter) {22. curFilter = data.filter().filters;23. }24. else {25. curFilter = [];26. }27. var filter = { logic: "or", filters: curFilter };28. var values = this.value();29. $.each(values, function (i, v) {30. filter.filters.push({ field: fieldName, operator: "eq", value: v });31. });32. console.log(this.dataSource.data());33. $("#grid").data("kendoGrid").dataSource.filter(filter);34. }35. });36. }