DataGrid builder
A grid that renders only the rows its viewport holds.
A builder is RenderOnce. Construct and mount it in one expression.
use gpui_kit::data::DataGrid;
Construct
new(ident: impl Into<Ident>, count: usize, render_row: impl Fn(usize, &mut Window, &mut App) -> GridRow + 'static) -> SelfOptions
Chain onto the value.
total(total: usize) -> Self
column(column: GridColumn) -> Self
columns(columns: impl IntoIterator<Item = GridColumn>) -> Self
lines(lines: GridLines) -> Self
sort(sort: Option<(SharedString, SortDirection)>) -> Self
sorted_by(key: impl Into<SharedString>, direction: SortDirection) -> Self
selection_mode(mode: SelectionMode) -> Self
selected(ids: impl IntoIterator<Item = impl Into<SharedString>>) -> Self
expanded(rows: impl IntoIterator<Item = Expanded>) -> Self
detail_rows(rows: usize) -> Self
detail(render: impl Fn(SharedString, &mut Window, &mut App) -> AnyElement + 'static) -> Self
editing(cell: Option<EditingCell>) -> Self
row_height(height: f32) -> Self
visible_rows(rows: usize) -> Self
loading(loading: bool) -> Self
failure(failure: impl Into<SharedString>) -> Self
empty(empty: EmptyState) -> Self
on_sort(handler: impl Fn(SharedString, SortDirection, &mut Window, &mut App) + 'static) -> Self
on_select(handler: impl Fn(&SelectionChange, &mut Window, &mut App) + 'static) -> Self
on_resize(handler: impl Fn(SharedString, f32, &mut Window, &mut App) + 'static) -> Self
on_fit(handler: impl Fn(SharedString, &mut Window, &mut App) + 'static) -> Self
on_reorder(handler: impl Fn(&DropIntent, &mut Window, &mut App) + 'static) -> Self
on_expand(handler: impl Fn(SharedString, bool, &mut Window, &mut App) + 'static) -> Self
on_edit_request(handler: impl Fn(SharedString, SharedString, &mut Window, &mut App) + 'static) -> Self
on_edit(handler: impl Fn(&EditIntent, &mut Window, &mut App) + 'static) -> SelfRendered by
Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.
Source: crates/gpui-kit/src/data/grid.rs