filter: "wordStartsWith"

4 posts, 1 answers
  1. Shea
    Shea avatar
    58 posts
    Member since:
    Feb 2013

    Posted 23 Nov 2013 Link to this post

    I need to have my combo box filter on items that have a word that starts with the text typed.
    So typing 'and':

    thousand - no
    And Cats - yes
    Andales - yes
    sandman - no

    Using contains would show all of those. Is it possible to have a custom filter that would just show And Cats, and Andales?

    ~S
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 25 Nov 2013 Link to this post

    Hi Shea,


    To achieve this you should use the filter configuration option of the ComboBox and set it to startswith.

    I wish you a great day!

    Regards,
    Dimiter Madjarov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Shea
    Shea avatar
    58 posts
    Member since:
    Feb 2013

    Posted 25 Nov 2013 Link to this post

    Dimiter,

    Thanks for the reply. I make a mistake explaining my question.

    I want the filter to be aware of 'words', so that 'and' matches 'one and two'. Using startsWith, 'one and two' would not match 'and' would it? In my tests it does not.
  5. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 25 Nov 2013 Link to this post

    Hi Shea,


    There is no such built in filter. Nevertheless in the current scenario you could set any type of filter, for example "contains" (because the filtering is disabled by default) and enable the serverFiltering option of the dataSource. In this case the developer is responsible to manually perform the filtering on the back end and return the matched items to the widget.

    Regards,
    Dimiter Madjarov
    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