Configure Kendo Grid Search Toolbar to filter only visible columns?

2 Answers 491 Views
Grid Toolbar
Philip
Top achievements
Rank 1
Veteran
Iron
Philip asked on 12 Jul 2022, 06:53 PM
I have a kendo grid which has the search filter enabled. I notice the search filters data based on the hidden columns as well. I'd like to have the search bar filter data based only on the visible columns. Is there a way to do this?

2 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 15 Jul 2022, 08:34 AM

Hello Philip,

You can specify the visible column to be included in the search by including them in the search.fields list:

search: {
              fields: ["Freight", "OrderDate", "ShipName", "ShipCity"]
            },

Here is a Dojo demo demonstrating this: https://dojo.telerik.com/ErISoxIz

Regards,
Nikolay
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Philip
Top achievements
Rank 1
Veteran
Iron
answered on 20 Jul 2022, 03:57 PM | edited on 20 Jul 2022, 03:58 PM

Hi Nikolay,

Thank you for providing a solution. In the Kendo Grid there is an option in the column's context menu to show and hide columns. Is there an easy way to have the Grid search only the visible columns that the user dynamically chooses to show?

Nikolay
Telerik team
commented on 25 Jul 2022, 12:00 PM

Hi Philip,

I am afraid this is not available built-in and to achieve this you will need to implement a custom filtering with a single text box and modify its logic when the user hides/shows a column in the columnShow/columnHideevent handlers.

Regards,

Nikolay

Tags
Grid Toolbar
Asked by
Philip
Top achievements
Rank 1
Veteran
Iron
Answers by
Nikolay
Telerik team
Philip
Top achievements
Rank 1
Veteran
Iron
Share this question
or