Skip to content Skip to sidebar Skip to footer

How To Set Filter Property Through Javascript Or Jquery For A Kendo Dropdown

I have a kendo dropdown list in cshtml. I wanted to set filter property in Jquery or javasctipt. Could you please tell me how to acheive this? Appreciate your help on this. @(Htm

Solution 1:

UPDATE: if filter was not set upon creation, destroy and re-initialize with the filter

In JavaScript/jQuery get the dropdownlist and call destroy():

var dropdownlist = $("#movies").data("kendoDropDownList");
dropdownlist.destroy();

Then recreate with filter:

$("#products").kendoDropDownList({dataTextField:"ProductName",dataValueField:"ProductID",dataSource: {
    transport: {
         read: {
            dataType:"jsonp",
            url:"https://demos.telerik.com/kendo-ui/service/Products",
         }
    }
  },filter:filt});

DEMO

Post a Comment for "How To Set Filter Property Through Javascript Or Jquery For A Kendo Dropdown"