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

Custom date filter (30, 60, 90 day)

1 Answer 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 07 Dec 2016, 10:49 AM

I'm trying to create a custom filter on a date field to show items that have a date in the next 30, 60 and 90 days, including any overdue (i.e. dated in the past).

The current code creates a filter with the needed options, but how can the filters be implemented? The 30 day filter is to be applied when the data is loaded initially.

var pending = [ "60 days", "90 days" ];
 
var riskFilter = function(e) {
   e.kendoDropDownList({  optionLabel: "30 days", dataSource: pending });
}
 
$('#current-reviews').kendoGrid({
     theme: 'npw',
     columns: [
          { width: "240px", field: "nextreview", title: "Next Review Date",
            format: "{0:dd MMMM yyyy}", filterable: { ui: pendingFilter } },
],
filterable: {
       extra: false,
       operators: {
          date: {
           lte: "Is due within"
          }
       }
 }

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 09 Dec 2016, 08:07 AM
Hello Kevin,

The scenario you have described is not supported out-of-the-box. To achieve this you will need to unbind the filter menu widgets and handle the creation of the filter descriptors yourself. Here you can find a test page which demonstrates a possible basic implementation of such functionality.

Regards,
Rosen
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or