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

Filter multiple fields

1 Answer 167 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Janos
Top achievements
Rank 1
Janos asked on 13 Apr 2016, 01:13 PM

Is there a way to enable the multi-select widget to filter more than one field?

Let's say we want to filter data like the following:

var data = [
  {
    name: "ABC",
    city: "City1",
    id: 123
  },
  {
    name: "DEF",
    city: "City2",
    id:456
  }
];

The dataTextField is "id" as well as the dataValueField:

$scope.selectOptions = {
      dataTextField: "id",
      dataValueField: "id",
      valuePrimitive: true,
      autoBind: false,
      tagMode: "single",
      filter: "contains",
      filtering: function(e) {
        // magic here?
        }
      },
      dataSource: {
        transport: {
          read: function(options) {
            //get data
            });
          }
        }
      }
    };

How can I achieve that the multi-select suggestions show all items which field values contain the letter "D"?

 

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 15 Apr 2016, 12:57 PM
Hi Janos,

This behavior is not supported out of the box. You could however, use server-side filtering, which will allow you to apply the filtering criteria to any field necessary.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MultiSelect
Asked by
Janos
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or