Clear search on open ComboBox

5 posts, 0 answers
  1. Janusz
    Janusz avatar
    18 posts
    Member since:
    Jan 2015

    Posted 25 Mar 2015 Link to this post

    I have ComboBox, with seted filter to "contins" and serverFiltering to true.
    It is possible to clear previous filter (when user enter text into CB) ? because now user need to clear whole combo box to reset filter.
  2. Janusz
    Janusz avatar
    18 posts
    Member since:
    Jan 2015

    Posted 25 Mar 2015 Link to this post

    It will be good to have dit option on forum :)

    One more think: I know that is possible with search('') but it cause open CB.
  3. Kendo UI is VS 2017 Ready
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 26 Mar 2015 Link to this post

    Hello Janusz,

    One possible way to accomplish your goal is to clear the input value and reset the data source filters:
    //clear text
    combobox.text("");
     
    //reset filters
    combobox.dataSource.filter({});

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Janusz
    Janusz avatar
    18 posts
    Member since:
    Jan 2015

    Posted 30 Mar 2015 Link to this post

    Ok, it will work :
    combobox.dataSource.filter({});

    but I lost cascade filter :)
  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 01 Apr 2015 Link to this post

    Hello Janusz,

    Indeed, you will clear all filters with .filter({}) method call. What you can do is to get the applied filters, strip only the one you want and re-filter the source. This is something that the widget itself does (link to the source).

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready