From dd1c5b475b16f22265dba5499f7e597cc10cd9af Mon Sep 17 00:00:00 2001 From: melloware Date: Thu, 29 Sep 2022 07:42:59 -0400 Subject: [PATCH] Fix #3384: Datable expose a few more methods to ref --- components/lib/datatable/DataTable.js | 11 +++++++---- components/lib/datatable/datatable.d.ts | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/components/lib/datatable/DataTable.js b/components/lib/datatable/DataTable.js index 1cbcc68b54..9dac14ea3b 100644 --- a/components/lib/datatable/DataTable.js +++ b/components/lib/datatable/DataTable.js @@ -1345,14 +1345,17 @@ export const DataTable = React.forwardRef((props, ref) => { React.useImperativeHandle(ref, () => ({ props, - reset, - resetScroll, + clearState, + closeEditingCell, exportCSV, filter, + reset, resetColumnOrder, - closeEditingCell, + resetScroll, + restoreColumnWidths, + restoreState, restoreTableState, - clearState, + saveState, getElement: () => elementRef.current, getTable: () => tableRef.current, getVirtualScroller: () => virtualScrollerRef.current diff --git a/components/lib/datatable/datatable.d.ts b/components/lib/datatable/datatable.d.ts index e75664a6a8..e212ded119 100644 --- a/components/lib/datatable/datatable.d.ts +++ b/components/lib/datatable/datatable.d.ts @@ -366,14 +366,17 @@ export interface DataTableProps extends Omit { - public reset(): void; - public resetScroll(): void; + public clearState(): void; + public closeEditingCell(): void; public exportCSV(options?: { selectionOnly: boolean }): void; public filter(value: T, field: string, mode: DataTableFilterMatchModeType, index?: number): void; + public reset(): void; public resetColumnOrder(): void; - public closeEditingCell(): void; + public resetScroll(): void; + public restoreColumnWidths(): void; + public restoreState(): void; public restoreTableState(state: any): void; - public clearState(): void; + public saveState(): void; public getElement(): HTMLDivElement; public getTable(): HTMLTableElement; public getVirtualScroller(): VirtualScroller;