Skip to main content

GridHeaderLayout, VirtualizedGridStatus

Reference​

  • GridHeaderLayout is the toolbar row placed above a grid. It has a left area and a right area, with the same height and padding as the toolbar of the standard grids.
  • VirtualizedGridStatus shows the record count text (for example 17007 records). It renders nothing when the count is less than 1.
  • Used together they give a custom drill-down grid the same header as the standard drill-down: the export button on the left and the record count on the right.

GridHeaderLayout Props​

  1. leftHeader — Content for the left area (for example an ExportCSVButton).
  2. rightHeader — Content for the right area (for example VirtualizedGridStatus).

VirtualizedGridStatus Props​

  1. totalRecords

    • Type: number
    • Description: The total number of records. Nothing is rendered when it is less than 1.
  2. selectedRowsCount

    • Type: number
    • Description: When set, the text becomes Selected {selectedRowsCount} of {totalRecords} records.
  3. style

    • Type: object
    • Default: {}
    • Description: Extra styles for the text container.

Usage Example​

function Example() {
const { protrakComponents } = React.useContext(customWidgetContext);
const { GridHeaderLayout, VirtualizedGridStatus, ExportCSVButton } = protrakComponents;

return (
<GridHeaderLayout
leftHeader={<ExportCSVButton data={items} headers={csvHeaders} filename="export" />}
rightHeader={<VirtualizedGridStatus totalRecords={totalCount} />}
/>
);
}