Custom filtering on grid not working

0 Answers 136 Views
Filter Grid
Monica
Top achievements
Rank 1
Iron
Monica asked on 20 Dec 2022, 03:36 PM | edited on 20 Dec 2022, 03:37 PM

Hi,

When I tried to filter the grid by pressing the buttons on top of the grid, the filtering does not appear to work.

I just dont know where I went wrong. I have done quite a few of them without issues, but on this one, i cannot see where the problem is. I have now triple check the code and I still can't see it!

Adding here a link to the dojo: https://dojo.telerik.com/@galedin/EXAZIJIx

 

Thanks,

 

 

Nikolay
Telerik team
commented on 22 Dec 2022, 08:00 AM

Hi Monica,

I think you did i great job obtaining the filter object and now you just need to pass it to the data source filter() method:

        function filterTestId(id) {
          var grid = $("#grid").data("kendoGrid");

          if (id != 0) {
            let filterGroup = {
              FilterName: "TestIDFilterGroup",
              logic: "and",
              filters: []
            };

            filterGroup.filters.push({
              field: "TestId", operator: "eq", value: id, FilterName: "TestIDFilterGroup"
            });
            grid.dataSource.filter(filterGroup)

          }

Updated Dojo: https://dojo.telerik.com/AtAmekUN

In case the requirement is different please let me now.

Regards,

Nikolay

Monica
Top achievements
Rank 1
Iron
commented on 22 Dec 2022, 11:25 PM

Thank you! one of those doh! moments. I was actually trying to create a simple dojo to replicate a problem I was experiencing but it works on the dojo, so not sure what else could be causing it. Since then, i have updated from 2022.1.412 to 2022.3.1109 and the filtering in a virtual grid appears to work ok now, on previous version the grid just hang, and we couldn't scroll, the scroll bar will move but not the content on the grid. It worked ok if the filtering was displaying 17 items, however when displaying 85, it will hang. As a note the pageSize is set to 100 ...Just mentioning this in case you know or have any information . Again Thank You!
Nikolay
Telerik team
commented on 27 Dec 2022, 03:10 PM

Hi Monica,

I am happy to hear I was able to help.

Regarding the filtering problem, there was, indeed, a bug that was fixed with the 2022.3.913 release. I will leave it below for your reference.

You can also check the release notes from this release or from any other here.

Regards,

Nikolay

 

 

No answers yet. Maybe you can help?

Tags
Filter Grid
Asked by
Monica
Top achievements
Rank 1
Iron
Share this question
or