Skip to content

Commit abed32f

Browse files
GridCore: add methods to HeaderPanel to add/remove toolbar items (#33118)
1 parent 5888330 commit abed32f

File tree

14 files changed

+726
-105
lines changed

14 files changed

+726
-105
lines changed

packages/devextreme/js/__internal/grids/data_grid/export/m_export.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,6 @@ const headerPanel = (Base: ModuleType<HeaderPanel>) => class ExportHeaderPanelEx
731731

732732
if (exportButton) {
733733
items.push(exportButton);
734-
this._correctItemsPosition(items);
735734
}
736735

737736
return items;
@@ -840,10 +839,6 @@ const headerPanel = (Base: ModuleType<HeaderPanel>) => class ExportHeaderPanelEx
840839
return items;
841840
}
842841

843-
private _correctItemsPosition(items) {
844-
items.sort((itemA, itemB) => itemA.sortIndex - itemB.sortIndex);
845-
}
846-
847842
private _isExportButtonVisible() {
848843
return this.option('export.enabled');
849844
}

packages/devextreme/js/__internal/grids/grid_core/filter/m_filter_row.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Menu from '@js/ui/menu';
1313
import Overlay from '@js/ui/overlay/ui.overlay';
1414
import { selectView } from '@js/ui/shared/accessibility';
1515
import type { ColumnsController } from '@ts/grids/grid_core/columns_controller/m_columns_controller';
16+
import type { ToolbarItem } from '@ts/grids/new/grid_core/toolbar/types';
1617
import Editor from '@ts/ui/editor/editor';
1718
import type MenuInternal from '@ts/ui/menu/menu';
1819

@@ -972,16 +973,16 @@ const headerPanel = (Base: ModuleType<HeaderPanel>) => class FilterRowHeaderPane
972973
}
973974
}
974975

975-
protected _getToolbarItems() {
976+
protected _getToolbarItems(): ToolbarItem[] {
976977
const items = super._getToolbarItems();
977978
const filterItem = this._prepareFilterItem();
978979

979980
return filterItem.concat(items);
980981
}
981982

982-
private _prepareFilterItem() {
983+
private _prepareFilterItem(): ToolbarItem[] {
983984
const that = this;
984-
const filterItem: object[] = [];
985+
const filterItem: ToolbarItem[] = [];
985986

986987
if (that._isShowApplyFilterButton()) {
987988
const hintText = that.option('filterRow.applyFilterText');
@@ -993,7 +994,7 @@ const headerPanel = (Base: ModuleType<HeaderPanel>) => class FilterRowHeaderPane
993994
const onClickHandler = function () {
994995
that._applyFilterViewController.applyFilter();
995996
};
996-
const toolbarItem = {
997+
const toolbarItem: ToolbarItem = {
997998
widget: 'dxButton',
998999
options: {
9991000
icon: 'apply-filter',

0 commit comments

Comments
 (0)