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

Mark the filter line in grid menu.

3 Answers 184 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andi
Top achievements
Rank 1
Andi asked on 16 Oct 2018, 07:46 AM

Is there a possibility to mark the filter line in the grid column menu as active?

The menu button itself is marked with .k-state-active, but the popup itself or the filter line is not. So the elements are not reachable with CSS.

Is there any solution to reach the element?

Thanks for your help and best regards,

Andi


3 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 18 Oct 2018, 06:44 AM
Hi Andi,

Indeed, by default the Grid Column Menu is rendered within a Popup that is appended to the application root and is not directly associated with the column menu icon in the Grid header.

To achieve the desired behavior, you can utilize the Column Menu template, and provide the inner building blocks in accordance with the desired Grid functionalities that need to be present:

https://www.telerik.com/kendo-angular-ui/components/grid/columns/menu/#toc-customizing-the-content

Then bind a custom class on the kendo-grid-columnmenu-filter component and implement some custom logic for checking whether a filter is applied to by the respective column field, and style the inner filter icon in accordance with your preference, e.g.:

https://stackblitz.com/edit/angular-ablrk8-q5wdby?file=app/app.component.ts

I hope this helps.

Regards,
Dimiter Topalov
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.
0
Andi
Top achievements
Rank 1
answered on 22 Oct 2018, 08:19 AM

Hi Dimiter,

your code helped a lot!

I tried a similar solution, but my mistake was, that I added a [class.is-active]="hasFilterByField(service)" on the kendo-grid-numeric-filter-menu element. The result was, that the marker was on the form containing element and not the menu. :-)

In your for loop, your code also need a break if the result is true, otherwise only the last filter has a highlighted icon.

And the css rule should be bound to .k-icon.k-i-filter otherwise all icons in the form (e.g. dropdown icon) will also be changed.

 

Kindest regards and thank a lot for your help and excellent support!

Andi

 

0
Dimiter Topalov
Telerik team
answered on 23 Oct 2018, 07:19 AM
Hi Andi,

Thank you very much for pointing out the provided enhancements so that other members of the community can also benefit from your feedback!

Regards,
Dimiter Topalov
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.
Tags
General Discussions
Asked by
Andi
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Andi
Top achievements
Rank 1
Share this question
or