This is a migrated thread and some comments may be shown as answers.

ComboBox - Filter on Multiple Columns?

1 Answer 509 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 28 May 2014, 10:32 PM
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"
                            kendo-combo-box   
                            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'"
                        >
                </select>



Is there a way to go about this ?



1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 29 May 2014, 11:30 AM
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:

http://jsbin.com/cevide/1/edit

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Mario Antonio
Top achievements
Rank 1
commented on 21 Apr 2022, 02:22 PM

Do you have a combobox and 2 columns filter example with dataSource API?

Thanks

Veselin Tsvetanov
Telerik team
commented on 25 Apr 2022, 06:55 AM

Hi Mario Antonio,

Here is an example of using the MultiColumnComboBox widget and filtering by multiple columns values:

https://demos.telerik.com/kendo-ui/multicolumncombobox/index

Please, note that we do not have a server-side filtering example where the remote endpoint is configured to work with two columns values.

Tags
ComboBox
Asked by
Eric
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or