ComboBox - Filter on Multiple Columns?

2 posts, 0 answers
  1. Eric
    Eric avatar
    2 posts
    Member since:
    Mar 2014

    Posted 28 May 2014 Link to this post

    How can I instruct the combo box filter to operate on multiple columns (in effect a composite search)?

    Simple example :
    Lets say I have a combo box with currencies.   The options looks someting like    " <Code> - <Name>  (<symbol>)". I want the "contains" filter to operate on name, code, and symbol.  Data looks something like :

       Currencies =  [
               {"Name": "Argentine Peso", "Code": "ARS", "Symbol": "$" },
               {"Name": "Armendian Dram", "Code": "AMD", "Symbol": "AMD"},
               {"Name": "Aruba Florin", "Code": "AWG", "Symbol": "ƒ"},
               {"Name": "Australian Dollar", "Code": "AUD", "Symbol": "$"}

    My Kendo declaration looks something like :

                    <select  name="Currency_RecordID"
                                k-data-source        = "DataModel.Currencies"
                                k-rebind            = "DataModel.Currencies"
                                k-placeholder        = "Labels.PleaseSelect"
                                k-data-text-field    = "'Name'"
                                k-data-value-field    = "'RecordID'"
                                k-value                = "LineModel.Currency.RecordID"
                                k-model                = "'LineModel'"
                                k-model-property    = "'Currency'"
                                k-filter            = "'contains'"
                                k-auto-bind            = "true"
                                k-min-length        = "1"
                                k-template            = "'#= Code # - #=Name# (#=Symbol#)'"
                                k-openOnFocus        = "'irrelevant'"
                                k-limitPredefined    = "'just quote me'"

    Is there a way to go about this ?

  2. Kiril Nikolov
    Kiril Nikolov avatar
    2543 posts

    Posted 29 May 2014 Link to this post

    Hello Eric,

    Filtering by multiple fields is not part of the built-in functionality of the Kendo UI Combobox.  You can filter the dataSource by multiple filters, but this could be done using the dataSource API and the query method, as in this example:

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top