DVUI

GridWidget

A scrollable grid widget for displaying tabular data. Also known as a table, TableWidget for grepping purposes. Features:

  • Optional headers.
  • Consistent or variable row heights.
  • Horizontal and vertical scrolling.
  • Individual cell styling.

If row_height_variable is false, rows and columns can be laid out in any order, including sparse layouts where not all rows or columns are provided.

If row_height_variable is true, rows must be laid out sequentially—either:

  1. All rows for a column before moving to the next column, or
  2. All columns for a row before moving to the next row.

See also:

  • CellStyle: helpers to style grid cells and widgets.
  • HeaderResizeWidget: draggable header resizing.
  • VirtualScroller: virtual scrolling through large datasets.

Fields

#
vbox:BoxWidget
BoxWidget
header_group:dvui.FocusGroupWidget

SAFETY: Set by headerScrollAreaCreate, is valid when hscroll is non-null

body_group:dvui.FocusGroupWidget

SAFETY: Set by bodyScrollAreaCreate, is valid when bscroll is non-null

scroll:ScrollAreaWidget
ScrollAreaWidget
hscroll:?ScrollAreaWidget
?ScrollAreaWidget
bscroll:?ScrollContainerWidget
?ScrollContainerWidget
hsi:ScrollInfo
ScrollInfo
bsi:*ScrollInfo

might point to default_scroll_info

frame_viewport:Point

SAFETY: Set in install

col_widths:[]f32
[]f32
starting_col_widths:?[]f32
?[]f32
resizing:bool
bool
header_height:f32
f32
last_row_height:f32
f32
sort_direction:SortDirection
SortDirection
sort_col_number:usize
usize
default_scroll_info:ScrollInfo
ScrollInfo
cols:WidthsOrNum
WidthsOrNum
row_height:f32
f32
max_row:usize
usize
cur_row:usize
usize
rows_y_offset:f32
f32
next_row_y:f32
f32
this_row_y:f32
f32
last_header_height:f32
f32
rows:std.array_hash_map.Auto(usize, dvui.Id)
std.array_hash_map.Auto(usize, dvui.Id)
init_opts:InitOpts
InitOpts