Disabling menu filter on individual columns

2 Answers 1535 Views
Grid
Jamie
Top achievements
Rank 1
Jamie asked on 13 Jun 2019, 01:40 PM

I have a grid with 10000+ items but with the menu filter mode enabled this poses a bit of a lag issue when trying to populate all of the dropdown options for the filter menu.

 

So I use:

filterable: {mode: "menu, row"}

 

Is it possible to have the menu filter mode enabled but disable it on a column by column basis? (See attached image for example of what I mean)

 

As always, thank you for your help.

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetomir
Telerik team
answered on 17 Jun 2019, 05:33 AM
Hello,

It is correct that setting the filterable property to false would disable both of the filter options. Given the scenario, there is not much on how to distinguish whether the column would have the menu or row filtering disabled. What I can recommend is to hide the filter icon for the specific columns. The menu is initialized only when the user clicks on the filter icon, therefore, only then, a request would be sent to obtain the relevant data items. 

So, if you are aware of the field of the column that you would like to hide, then, check out the following CSS rules:

<style>
  thead th[data-field='fieldName'] a.k-grid-filter{
    display: none;
  }
</style>

Give this suggestion a try and let me know how it works out for you.


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Jamie
Top achievements
Rank 1
commented on 05 Jul 2019, 07:55 AM

Hi Tsvetomir,

 

This may only be a workaround with CSS but it does exactly what I need :) Much appreciated.

 

Kind regards,

Jamie

0
Bridge24
Top achievements
Rank 1
answered on 13 Jun 2019, 02:44 PM

Yes you can set "filterable:false" column by column in your columns collection, as described in the documentation.

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/columns.filterable

Jamie
Top achievements
Rank 1
commented on 14 Jun 2019, 06:34 AM

Hi Bridge,

 

Setting filterable false will disable both filtering options (Menu and row) I want to disable the menu mode option only whilst still having the row filter enabled as shown in the image I attached.

Tags
Grid
Asked by
Jamie
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Bridge24
Top achievements
Rank 1
Share this question
or