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

[filters] kendo-grid-date-filter-cell

8 Answers 1894 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Edik
Top achievements
Rank 1
Edik asked on 26 Jun 2018, 03:10 PM
Hello,
I have a date field where i need to use a filter, but the main problem for my case is that i don't have an opportunity to edit filter options(e.g. is equal to, is not equal to, is after...) that are shown in the dropdown. In my case i need to use only four of them (equal, before, after, ends), so if there is a way to specify what exact options could be shown, I would like to know. 
Regards,
Edik

8 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 28 Jun 2018, 06:44 AM
Hi Edik,

You can customize the list of available operators by using the filter cell component for the respective data type:

https://www.telerik.com/kendo-angular-ui/components/grid/filtering/built-in-template/#toc-configuring-built-in-filters

... and adjust the order and number of filter operators by listing the desired operator components as demonstrated in the following section:

https://www.telerik.com/kendo-angular-ui/components/grid/filtering/built-in-template/#toc-setting-the-order-of-the-filter-operators

List of all available operator components is available in the Grid API:

https://www.telerik.com/kendo-angular-ui/components/grid/api/

Here is a runnable example, demonstrating the described approach:

https://plnkr.co/edit/7Cw4zy2vE6jJCynUA4tJ?p=preview

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Edik
Top achievements
Rank 1
answered on 28 Jun 2018, 06:53 AM
Thanks Dimiter, everything is great .
0
Edik
Top achievements
Rank 1
answered on 28 Jun 2018, 07:49 AM
And one more thing as i saw you made those changes for first gird  https://gyazo.com/6459e44b15139c940c9e272e8b7c6ed9  , I'm using this one   https://gyazo.com/cc0d52f7994688370054a12df33dad17 , is that possible for this exact grid?
0
Dimiter Topalov
Telerik team
answered on 29 Jun 2018, 01:27 PM
Hi Edik,

The approach for customizing the list of available operators when the Grid filtering mode is set to "menu" instead of "row", but in this case you will need to use a filter menu template (as opposed to a filter cell template):

https://www.telerik.com/kendo-angular-ui/components/grid/filtering/built-in-template/#toc-configuration-components-for-filter-templates



Here is the updated example:

https://plnkr.co/edit/9ulus1SdUMeTwXlusE9Y?p=preview

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Edik
Top achievements
Rank 1
answered on 02 Jul 2018, 06:41 AM
Thanks a lot!
0
Edik
Top achievements
Rank 1
answered on 03 Sep 2018, 08:58 AM

Hey @Dimiter Topalov, your help was huge to me, wanted to ask if there is a way to filter menu for both date picker fields(e.g. for top one is only available starts with or is after, and for the bottom placed date picker ends with or if before)?

Regards,

Edik

0
Edik
Top achievements
Rank 1
answered on 03 Sep 2018, 09:00 AM
customize date  filter menu*
0
Svet
Telerik team
answered on 05 Sep 2018, 05:47 AM
Hi Edik,

At the moment, the requested functionality is not available out of the box.

However, we can achieve the desired behavior by creating a reusable custom filter component. As long as we need a filter menu we need to follow the instructions provided in the following article:
https://www.telerik.com/kendo-angular-ui/components/grid/filtering/reusable-filter/#toc-filter-menu

The demonstrated example shows how to create the multicheck-filter.component.ts, which can then be reused for the different columns of the grid. For the specific use case, we will need a similar approach, that follows the provided guidelines in the referenced article above.

Indeed, using this approach we will not be able to benefit from the provided built in filter templates, like the kendo-grid-date-filter-menu, which in turn can use a number of provided operators. Rather, we will need to create the logic for creating the required CompositeFitlerDescriptor passed to the filter method of the filterService on our own. 

I hope this points you in the right direction of creating the desired custom filter component.

Regards,
Svetlin
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
Edik
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Edik
Top achievements
Rank 1
Svet
Telerik team
Share this question
or