Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

How can I programmatically clear the DropDownList filter?

$
0
0

I am using Javascript and have a kendo drop down list like so:

$("#ddl).kendoDropDownList({
dataTextField: "name",
dataValueField: "id",
filter: "contains",

dataSource: {
    data: [
      {id: 1, name: "apples"},
      {id: 2, name: "oranges"},
      {id: 3, name: "apples2"},
      {id: 4, name: "oranges2"}]
  }
});

 

As a user, I open the drop down list, type "apples" into the filter, and select "apples".  Then I activate a function (though clicking a button), that attempts to programmatically change the drop down list to the "oranges" value (index 1, id 2).  However, the filterInput is still active, and attempts to set the drop down list to index 1 instead sets it to index 1 of the filtered drop down list ("apples2").

I know I can access the filterInput programmatically.  How can I programmatically clear the filterInput and set the drop down list value to "oranges"?


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>