Datasource filter and templates columns in grid

1 Answer 16 Views
Grid
Roel
Top achievements
Rank 1
Veteran
Roel asked on 28 Jun 2021, 02:28 PM

Hi,

At the moment I am using filters to filter a grid like below:

var filter =
{
    filters:
        [

             { field: "Done", operator: "eq", value: value }
          ]
}

But the filtred status uses a client template like below:

<div style='text-align:center;'><span  style='font-size: 1.4em;' class='fa-stack'># if(data.Done=='1') {# <i class='fa fa-square fa-stack-1x' style='color: white;'></i><i class='fa fa-check-square fa-stack-1x' style='color: \\#4d6992'></i> #} else if(data.Done=='0') {# <i class='fa fa-square' style='color: \\#bfccd3'></i> # } # </span></div>

What is the best way to filter on this column?

Roel

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 01 Jul 2021, 08:40 AM

Hello, Roel,

Thank you for the provided snippet.

The filters are applied to the dataSource itself, not the grid. The Grid's column templates are used to change the appearance of the data, so they have no direct relation to the filter itself. You should be able to use the filtering capabilities of the grid with columns that have templates, the same way you use them on regular columns.

Example:

https://dojo.telerik.com/@gdenchev/IqUWeKOz 

Best Regards,
Georgi Denchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Roel
Top achievements
Rank 1
Veteran
Answers by
Georgi Denchev
Telerik team
Share this question
or