Skip to content

Commit

Permalink
feat: SRVTRI-3123 Add defaultPostSort option (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaga authored Aug 30, 2024
1 parent a331b24 commit 23ca37c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface GridBaseRow {

export interface GridProps {
readOnly?: boolean; // set all editables to false when read only, make all styles black, otherwise style is gray for not editable
defaultPostSort?: boolean; // Retain sort order after edit, Defaults to true.
selectable?: boolean;
theme?: string; // should have prefix ag-theme-
["data-testid"]?: string;
Expand Down Expand Up @@ -114,6 +115,7 @@ export interface GridProps {
*/
export const Grid = ({
"data-testid": dataTestId,
defaultPostSort = true,
rowSelection = "multiple",
suppressColumnVirtualization = true,
theme = "ag-theme-step-default",
Expand Down Expand Up @@ -742,7 +744,7 @@ export const Grid = ({
onModelUpdated={onModelUpdated}
onGridReady={onGridReady}
onSortChanged={ensureSelectedRowIsVisible}
postSortRows={params.onRowDragEnd ? undefined : postSortRows}
postSortRows={params.onRowDragEnd || !defaultPostSort ? undefined : postSortRows}
onSelectionChanged={synchroniseExternalStateToGridSelection}
onColumnMoved={params.onColumnMoved}
alwaysShowVerticalScroll={params.alwaysShowVerticalScroll}
Expand Down

0 comments on commit 23ca37c

Please sign in to comment.