Skip to main content

DataGrid

Function DataGrid 

Source
pub fn DataGrid(_: DataGridProps) -> Element
Expand description

The data grid. Arrows move, Shift extends the selection, Home and End go to the row ends (with Ctrl, the grid’s corners), Page Up and Page Down move ten rows, Ctrl+Space selects the row, and Enter or F2 edits. Tab leaves the grid.

§Props

For details, see the props struct definition.

  • label : AccessibleName
  • columns : Vec<GridColumn>
  • rows : ReadSignal<Vec<Vec<GridCell>>>

    A signal, so a large sheet is shared rather than copied into each render.

  • row_headers : bool

    Numbers each row in a sticky header column.

  • total_rows : Option<usize>

    The true row count when only a window of rows is rendered, so a screen reader is told the real size.

  • first_row : usize

    The zero-based index of the first rendered row within total_rows.

  • active : CellRef

    The cell active on first render.

  • anchor : Option<CellRef>

    Where the first render’s selection starts; the active cell when omitted.

  • editing : Option<CellRef>

    A cell that starts in edit mode, such as the first cell of a new row.

  • onedit : Option<EventHandler<GridEdit>>
  • onselect : Option<EventHandler<CellRange>>
  • class : Option<String>
  • attributes : Vec<Attribute>