Function useGridAction

Executes grid actions and row actions.

  • Type Parameters

    • Data extends unknown = any

      The type of data in the grid rows.

    Parameters

    • Object: IParams<Data>

      The parameters for the useGridAction function.

    Returns {
        commitAction: ((p?: string) => Promise<null | void>);
        commitRowAction: ((action: string, row: Data) => Promise<null | void>);
        deselectAll: (() => void);
        gridProps: {
            onSelectedRows: ((rowIds: string[]) => void);
            selectedRows: string[];
        };
        selectedRows: string[];
    }

    An object containing the following properties:

    • deselectAll - A function that deselects all rows in the grid.
    • selectedRows - An array of selected rows in the grid.
    • gridProps - The grid properties.
    • commitAction - A function that commits a grid action. This function receives the action name and calls the onAction callback function with the selected rows.
    • commitRowAction - A function that commits a row action. This function receives the action name and the row and calls the onRowAction callback function.
    • commitAction: ((p?: string) => Promise<null | void>)
        • (p?): Promise<null | void>
        • Parameters

          • Optionalp: string

          Returns Promise<null | void>

    • ReadonlycommitRowAction: ((action: string, row: Data) => Promise<null | void>)
        • (action, row): Promise<null | void>
        • Parameters

          • action: string
          • row: Data

          Returns Promise<null | void>

    • deselectAll: (() => void)
        • (): void
        • Returns void

    • gridProps: {
          onSelectedRows: ((rowIds: string[]) => void);
          selectedRows: string[];
      }
      • ReadonlyonSelectedRows: ((rowIds: string[]) => void)
          • (rowIds): void
          • Parameters

            • rowIds: string[]

            Returns void

      • selectedRows: string[]
    • selectedRows: string[]