-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Grids: Fix columns[].headerFilter.groupInterval Placeholders #8853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
arman-boyakhchyan
merged 2 commits into
DevExpress:25_2
from
arman-boyakhchyan:grids-column-header-filter-groupinterval-fix-25-2
Jun 10, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
158 changes: 158 additions & 0 deletions
158
... UI Components/dxDataGrid/1 Configuration/columns/headerFilter/groupInterval.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| --- | ||
| id: dxDataGrid.Options.columns.headerFilter.groupInterval | ||
| type: Enums.HeaderFilterGroupInterval | Number | undefined | ||
| default: undefined | ||
| --- | ||
| --- | ||
| ##### shortDescription | ||
| Specifies how the header filter combines values into groups. | ||
|
|
||
| --- | ||
| If you [specify a custom header filter data source](/concepts/05%20UI%20Components/DataGrid/99%20How%20To/Customize%20Header%20Filter%20Data%20Source/10%20Specify%20a%20Custom%20Data%20Source.md '/Documentation/Guide/UI_Components/DataGrid/How_To/Customize_Header_Filter_Data_Source/#Specify_a_Custom_Data_Source'), **groupInterval** accepts only string arrays that contain group fields for [hierarchical header filters](/concepts/05%20UI%20Components/DataGrid/75%20Implement%20a%20Hierarchical%20Header%20Filter/00%20Implement%20a%20Hierarchical%20Header%20Filter.md '/Documentation/Guide/UI_Components/DataGrid/Implement_a_Hierarchical_Header_Filter/'). | ||
|
|
||
| For numeric columns, assign a number that specifies the size of generated groups. For an example of this **groupInterval** implementation, refer to the following demo: | ||
|
|
||
| #include common-demobutton-named with { | ||
| url: "https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/Filtering/", | ||
| name: "DataGrid - Filtering" | ||
| } | ||
|
|
||
| For date columns, set this property to a [HeaderFilterGroupInterval](/api-reference/40%20Common%20Types/15%20grids/HeaderFilterGroupInterval.md '/Documentation/ApiReference/Common_Types/grids/#HeaderFilterGroupInterval') value. This value indicates the smallest available filter value. For instance, the *"day"* value allows you to filter date columns by a specific day. | ||
|
|
||
| The default header filter for date columns is hierarchical. To implement a non-hierarchical header filter, set **groupInterval** to **null** and specify the [calculateFilterExpression](/api-reference/_hidden/GridBaseColumn/calculateFilterExpression.md '/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/columns/#calculateFilterExpression') function: | ||
|
|
||
| --- | ||
| ##### jQuery | ||
|
|
||
| <!-- tab: index.js --> | ||
| $(function() { | ||
| $("#{widgetName}Container").dx{WidgetName}({ | ||
| // ... | ||
| columns: [{ | ||
| // ... | ||
| dataType: 'date', | ||
| headerFilter: { | ||
| groupInterval: null | ||
| }, | ||
| calculateFilterExpression(value, operation, target) { | ||
| if(value && target === "headerFilter") { | ||
| return [this.dataField, operation, value]; | ||
| } | ||
| return this.defaultCalculateFilterExpression.apply(this, arguments); | ||
| } | ||
| }] | ||
| }); | ||
| }); | ||
|
|
||
| ##### Angular | ||
|
|
||
| <!-- tab: app.component.html --> | ||
| <dx-{widget-name} ... > | ||
| <dxi-{widget-name}-column ... | ||
| dataType="date" | ||
| [calculateFilterExpression]="calculateFilterExpression"> | ||
| <dxo-{widget-name}-header-filter | ||
| [groupInterval]="null" | ||
| ></dxo-{widget-name}-header-filter> | ||
| </dxi-{widget-name}-column> | ||
| </dx-{widget-name}> | ||
|
|
||
| <!-- tab: app.component.ts --> | ||
| import { Component } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-root', | ||
| templateUrl: './app.component.html', | ||
| styleUrls: ['./app.component.css'] | ||
| }) | ||
| export class AppComponent { | ||
| calculateFilterExpression(value, operation, target) { | ||
| const column = this as any; | ||
|
|
||
| if(value && target === "headerFilter") { | ||
| return [column.dataField, operation, value]; | ||
| } | ||
| return column.defaultCalculateFilterExpression.apply(column, arguments); | ||
| } | ||
| } | ||
|
|
||
| <!-- tab: app.module.ts --> | ||
| import { BrowserModule } from '@angular/platform-browser'; | ||
| import { NgModule } from '@angular/core'; | ||
| import { AppComponent } from './app.component'; | ||
|
|
||
| import { Dx{WidgetName}Module } from 'devextreme-angular'; | ||
|
|
||
| @NgModule({ | ||
| declarations: [ | ||
| AppComponent | ||
| ], | ||
| imports: [ | ||
| BrowserModule, | ||
| Dx{WidgetName}Module | ||
| ], | ||
| providers: [ ], | ||
| bootstrap: [AppComponent] | ||
| }) | ||
| export class AppModule { } | ||
|
|
||
| ##### Vue | ||
|
|
||
| <!-- tab: App.vue --> | ||
| <template> | ||
| <Dx{WidgetName} ... > | ||
| <DxColumn ... | ||
| data-type="date" | ||
| :calculate-filter-expression="calculateFilterExpression"> | ||
| <DxHeaderFilter | ||
| :group-interval="null" | ||
| /> | ||
| </DxColumn> | ||
| </Dx{WidgetName}> | ||
| </template> | ||
|
|
||
| <script> | ||
| import 'devextreme/dist/css/dx.fluent.blue.light.css'; | ||
|
|
||
| import { Dx{WidgetName}, DxColumn, DxHeaderFilter } from 'devextreme-vue/{widget-name}'; | ||
|
|
||
| function calculateFilterExpression(value, operation, target) { | ||
| const column = this; | ||
|
|
||
| if(value && target === "headerFilter") { | ||
| return [column.dataField, operation, value]; | ||
| } | ||
| return column.defaultCalculateFilterExpression.apply(column, arguments); | ||
| } | ||
| </script> | ||
|
|
||
| ##### React | ||
|
|
||
| <!-- tab: App.tsx --> | ||
| import React from 'react'; | ||
| import 'devextreme/dist/css/dx.fluent.blue.light.css'; | ||
|
|
||
| import { {WidgetName}, Column, HeaderFilter } from 'devextreme-react/{widget-name}'; | ||
|
|
||
| function calculateFilterExpression (value, operation, target) { | ||
| if(value && target === "headerFilter") { | ||
| return [this.dataField, operation, value]; | ||
| } | ||
| return this.defaultCalculateFilterExpression.apply(this, arguments); | ||
| } | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <{WidgetName} ... > | ||
| <Column ... | ||
| dataType="date" | ||
| calculateFilterExpression={calculateFilterExpression}> | ||
| <HeaderFilter | ||
| groupInterval={null} | ||
| /> | ||
| </Column> | ||
| </{WidgetName}> | ||
| ); | ||
| } | ||
|
|
||
| --- |
158 changes: 158 additions & 0 deletions
158
... UI Components/dxTreeList/1 Configuration/columns/headerFilter/groupInterval.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| --- | ||
| id: dxTreeList.Options.columns.headerFilter.groupInterval | ||
| type: Enums.HeaderFilterGroupInterval | Number | undefined | ||
| default: undefined | ||
| --- | ||
| --- | ||
| ##### shortDescription | ||
| Specifies how the header filter combines values into groups. | ||
|
|
||
| --- | ||
| If you [specify a custom header filter data source](/concepts/05%20UI%20Components/DataGrid/99%20How%20To/Customize%20Header%20Filter%20Data%20Source/10%20Specify%20a%20Custom%20Data%20Source.md '/Documentation/Guide/UI_Components/DataGrid/How_To/Customize_Header_Filter_Data_Source/#Specify_a_Custom_Data_Source'), **groupInterval** accepts only string arrays that contain group fields for [hierarchical header filters](/concepts/05%20UI%20Components/DataGrid/75%20Implement%20a%20Hierarchical%20Header%20Filter/00%20Implement%20a%20Hierarchical%20Header%20Filter.md '/Documentation/Guide/UI_Components/DataGrid/Implement_a_Hierarchical_Header_Filter/'). | ||
|
|
||
| For numeric columns, assign a number that specifies the size of generated groups. For an example of this **groupInterval** implementation, refer to the following demo: | ||
|
|
||
| #include common-demobutton-named with { | ||
| url: "https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/Filtering/", | ||
| name: "DataGrid - Filtering" | ||
| } | ||
|
|
||
| For date columns, set this property to a [HeaderFilterGroupInterval](/api-reference/40%20Common%20Types/15%20grids/HeaderFilterGroupInterval.md '/Documentation/ApiReference/Common_Types/grids/#HeaderFilterGroupInterval') value. This value indicates the smallest available filter value. For instance, the *"day"* value allows you to filter date columns by a specific day. | ||
|
|
||
| The default header filter for date columns is hierarchical. To implement a non-hierarchical header filter, set **groupInterval** to **null** and specify the [calculateFilterExpression](/api-reference/_hidden/GridBaseColumn/calculateFilterExpression.md '/Documentation/ApiReference/UI_Components/dxTreeList/Configuration/columns/#calculateFilterExpression') function: | ||
|
|
||
| --- | ||
| ##### jQuery | ||
|
|
||
| <!-- tab: index.js --> | ||
| $(function() { | ||
| $("#{widgetName}Container").dx{WidgetName}({ | ||
| // ... | ||
| columns: [{ | ||
| // ... | ||
| dataType: 'date', | ||
| headerFilter: { | ||
| groupInterval: null | ||
| }, | ||
| calculateFilterExpression(value, operation, target) { | ||
| if(value && target === "headerFilter") { | ||
| return [this.dataField, operation, value]; | ||
| } | ||
| return this.defaultCalculateFilterExpression.apply(this, arguments); | ||
| } | ||
| }] | ||
| }); | ||
| }); | ||
|
|
||
| ##### Angular | ||
|
|
||
| <!-- tab: app.component.html --> | ||
| <dx-{widget-name} ... > | ||
| <dxi-{widget-name}-column ... | ||
| dataType="date" | ||
| [calculateFilterExpression]="calculateFilterExpression"> | ||
| <dxo-{widget-name}-header-filter | ||
| [groupInterval]="null" | ||
| ></dxo-{widget-name}-header-filter> | ||
| </dxi-{widget-name}-column> | ||
| </dx-{widget-name}> | ||
|
|
||
| <!-- tab: app.component.ts --> | ||
| import { Component } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-root', | ||
| templateUrl: './app.component.html', | ||
| styleUrls: ['./app.component.css'] | ||
| }) | ||
| export class AppComponent { | ||
| calculateFilterExpression(value, operation, target) { | ||
| const column = this as any; | ||
|
|
||
| if(value && target === "headerFilter") { | ||
| return [column.dataField, operation, value]; | ||
| } | ||
| return column.defaultCalculateFilterExpression.apply(column, arguments); | ||
| } | ||
| } | ||
|
|
||
| <!-- tab: app.module.ts --> | ||
| import { BrowserModule } from '@angular/platform-browser'; | ||
| import { NgModule } from '@angular/core'; | ||
| import { AppComponent } from './app.component'; | ||
|
|
||
| import { Dx{WidgetName}Module } from 'devextreme-angular'; | ||
|
|
||
| @NgModule({ | ||
| declarations: [ | ||
| AppComponent | ||
| ], | ||
| imports: [ | ||
| BrowserModule, | ||
| Dx{WidgetName}Module | ||
| ], | ||
| providers: [ ], | ||
| bootstrap: [AppComponent] | ||
| }) | ||
| export class AppModule { } | ||
|
|
||
| ##### Vue | ||
|
|
||
| <!-- tab: App.vue --> | ||
| <template> | ||
| <Dx{WidgetName} ... > | ||
| <DxColumn ... | ||
| data-type="date" | ||
| :calculate-filter-expression="calculateFilterExpression"> | ||
| <DxHeaderFilter | ||
| :group-interval="null" | ||
| /> | ||
| </DxColumn> | ||
| </Dx{WidgetName}> | ||
| </template> | ||
|
|
||
| <script> | ||
| import 'devextreme/dist/css/dx.fluent.blue.light.css'; | ||
|
|
||
| import { Dx{WidgetName}, DxColumn, DxHeaderFilter } from 'devextreme-vue/{widget-name}'; | ||
|
|
||
| function calculateFilterExpression(value, operation, target) { | ||
| const column = this; | ||
|
|
||
| if(value && target === "headerFilter") { | ||
| return [column.dataField, operation, value]; | ||
| } | ||
| return column.defaultCalculateFilterExpression.apply(column, arguments); | ||
| } | ||
| </script> | ||
|
|
||
| ##### React | ||
|
|
||
| <!-- tab: App.tsx --> | ||
| import React from 'react'; | ||
| import 'devextreme/dist/css/dx.fluent.blue.light.css'; | ||
|
|
||
| import { {WidgetName}, Column, HeaderFilter } from 'devextreme-react/{widget-name}'; | ||
|
|
||
| function calculateFilterExpression (value, operation, target) { | ||
| if(value && target === "headerFilter") { | ||
| return [this.dataField, operation, value]; | ||
| } | ||
| return this.defaultCalculateFilterExpression.apply(this, arguments); | ||
| } | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <{WidgetName} ... > | ||
| <Column ... | ||
| dataType="date" | ||
| calculateFilterExpression={calculateFilterExpression}> | ||
| <HeaderFilter | ||
| groupInterval={null} | ||
| /> | ||
| </Column> | ||
| </{WidgetName}> | ||
| ); | ||
| } | ||
|
|
||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.