Skip to content

Commit

Permalink
Fix primefaces#3384: Datable expose a few more methods to ref
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Sep 29, 2022
1 parent b9959cb commit dd1c5b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions components/lib/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions components/lib/datatable/datatable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,17 @@ export interface DataTableProps extends Omit<React.DetailedHTMLProps<React.Input
}

export declare class DataTable extends React.Component<DataTableProps, any> {
public reset(): void;
public resetScroll(): void;
public clearState(): void;
public closeEditingCell(): void;
public exportCSV(options?: { selectionOnly: boolean }): void;
public filter<T>(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;
Expand Down

0 comments on commit dd1c5b4

Please sign in to comment.