rows

Function rows 

Source
pub fn rows(wgt: &mut WidgetBuilding, rows: impl IntoUiNode)
Expand description

B Row definitions.

Rows are defined by widgets, the row widget height defines the height of cells assigned to the row, the Row! widget is recommended, but you can use any widget to define a row. The row widget is rendered as the background of the row region, behind cells and in front of column backgrounds.

§Layout Modes

The grid uses the WIDGET_SIZE value to select one of three layout modes for rows:

  • Default, used for rows that do not set height or set it to Length::Default.
  • Exact, used for rows that set the height to an unit that is exact or only depends on the grid context.
  • Leftover, used for rows that set height to a lft value.

The row measure follows the same steps as columns, the only difference is that there is no overflow recovery for row heights exceeding the available height.

§Notes

Note that the row widget is not the parent of the cells that match it. Properties like padding and align only affect the row visual, not the cells, similarly contextual properties like text_color don’t affect the cells.

Note that the Default layout mode scales with the cell count, the other modes scale with the row count. This has less impact for rows, but you should consider setting a fixed row height for larger grids. Also note that you can define the auto_grow_fn instead of manually adding rows. With fixed heights a data table of up to 1000 rows with simple text cells should have good performance.

For massive data tables consider a paginating layout with a separate grid instance per page, the page grids don’t need to be actually presented as pages, you can use lazy loading and a simple stack layout to seamless virtualize data loading and presentation.

§Mixin Property

This property is a mixin, it modifies the widget builder during build, it does not produce a standalone UI node.