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

Multi filtering across many columns

2 Answers 1527 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 14 Jan 2016, 06:18 AM

Is it possible to configure the grid to use server filtering with multiple values (ie checkboxes) and have many columns in the filter. e.g.

(ColA = A) and (ColB = B or ColB = BB) and (ColC = C or ColC = CC)

After enabling server filtering on the grid we are using and setting the columns filterable property to include a datasource to read its values from the server, it looks like each column resets any other columns filter, only allowing a single column to contribute to the filter logic.

I notice that the demos for multi checkbox filtering seem to be able to do this, but they are using odata as the data source type for the overall grid.

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Rusev
Telerik team
answered on 18 Jan 2016, 07:27 AM

Hello Matt,

 

You can build such filters manually and apply them through the filter method (the link contains the structure of filter descriptors) of the DataSource.

 

When using column filtering, as in this example,  each column will using its field to build filter descriptor. Once filter is build and the user modify the filter for given column, filter menu will attempt to find, by using the field, the column filter descriptor and modify it.

 

When you apply filters on multiple columns then will form a group filter with "and" logic between them. For example if you apply filtering on the above example for columns "Freight" and "ShipName" the following filter descriptor will be build.

 

 

"{
  "filters": [
    {
      "field": "Freight",
      "operator": "eq",
      "value": 1
    },
    {
      "field": "ShipName",
      "operator": "eq",
      "value": "asdas"
    }
  ],
  "logic": "and"
}"

 

 

`I notice that the demos for multi checkbox filtering seem to be able to do this, but they are using odata as the data source type for the overall grid.` - Indeed the demo for Grid / Filter Multi Checkboxes is using OData, but that is not mandatory. Filter descriptors always have same format on client and they are translated to specific format by the parameterMap. In the example the type: "odata" redefines parameterMap which knows how to translate filter expressions to OData v.2.

 

Regards,

Nikolay Rusev

Telerik

 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Matt
Top achievements
Rank 1
answered on 20 Jan 2016, 03:04 AM

Thanks Nikolay! We are wanting to provide the filtering using kendo filter menu UI that is part of the grid, rather than setting custom filters via code. It seems that the team here changed a few things and now the filter menus on the columns work as we were expecting, when you press the filter button in each column it adds that columns filter values to the grids filter. Clearing removes that column from the grids filter.

 

 

Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Matt
Top achievements
Rank 1
Share this question
or