Data grid / foldkit-data-grid/crud

GridCrud

namespace · packages/data-grid/src/crud.ts:94

const GridCrud = { columns, rows, status }

In the guides

Members

GridCrud.columns

function · packages/data-grid/src/crud.ts:25

columns<
  Key extends string,
  Row extends {
    readonly [K in Key]: unknown
  },
  Options extends {
    readonly [K in Key]?: ColumnOptions<Row>
  },
>(
  list: {
    readonly columns: ReadonlyArray<DisplayColumn<Key>>
    readonly Row: Row
  },
  options?: {
    readonly words?: DisplayWords
    readonly columns?: Options
  },
): Columns<
  Row,
  {
    readonly [K in Key]: ColumnSpec<Row, string> & Options[K]
  }
>

The grid's columns for a list: one per listed member, keyed by its member key, headed by its label, its value the member's text as its Display says it. A member whose Display is hidden (usually the id) starts hidden: it is read, and can be shown, but is not drawn. columns adds what only the grid knows to a member's column: pinning, widths, edit, or another header; what it gives wins over what the list says.

GridCrud.rows

function · packages/data-grid/src/crud.ts:61

rows<Row>(
  page: RemoteData<Page<Row>>,
  key: (row: Row) => string,
): RowModel<Row>

GridCrud.status

function · packages/data-grid/src/crud.ts:84

status<Row>(page: RemoteData<Page<Row>>): RowStatus

Where a page stands, for the grid to say.