pub fn TableContent<Row, DataP, Err, ClsP, ScrollEl, ScrollM>(
props: TableContentProps<Row, DataP, Err, ClsP, ScrollEl, ScrollM>,
) -> impl IntoViewwhere
Row: TableRow<ClassesProvider = ClsP> + Clone + Send + Sync + 'static,
DataP: TableDataProvider<Row, Err> + 'static,
Err: Debug,
ClsP: TableClassesProvider + Send + Sync + Copy + 'static,
ScrollEl: IntoElementMaybeSignal<Element, ScrollM>,
ScrollM: ?Sized,
Expand description
Render the content of a table. This is the main component of this crate.
§Required Props
- rows: [
DataP
]- The data to be rendered in this table.
This must implement
TableDataProvider
or [PaginatedTableDataProvider
].
- The data to be rendered in this table.
This must implement
- scroll_container: [
ScrollEl
]- The container element which has scrolling capabilities.
§Optional Props
- on_change:
impl Into<EventHandler<ChangeEvent<Row>>>
- Event handler for when a row is edited. Check out the editable example.
- selection:
impl Into<Selection>
-
Selection mode together with the
RwSignal
to hold the selection. Available modes areNone
- No selection (default)Single
- Single selectionMultiple
- Multiple selection
Please see
Selection
for more information and check out the selectable example.
-
- on_selection_change:
impl Into<EventHandler<SelectionChangeEvent<Row>>>
- Event handler callback for when the selection changes. See the selectable example for details.
- thead_renderer:
impl Into<WrapperRendererFn>
- Renderer function for the table head. Defaults to
DefaultTableHeadRenderer
. For a full example see the custom_renderers_svg example.
- Renderer function for the table head. Defaults to
- tbody_renderer:
impl Into<TbodyRendererFn>
- Renderer function for the table body. Defaults to
DefaultTableBodyRenderer
. For a full example see the custom_renderers_svg example.
- Renderer function for the table body. Defaults to
- thead_row_renderer:
impl Into<WrapperRendererFn>
- Renderer function for the table head row. Defaults to
DefaultTableHeadRowRenderer
. For a full example see the custom_renderers_svg example.
- Renderer function for the table head row. Defaults to
- row_renderer:
impl Into<RowRendererFn<Row>>
- The row renderer. Defaults to
DefaultTableRowRenderer
. For a full example see the custom_renderers_svg example.
- The row renderer. Defaults to
- loading_row_renderer:
impl Into<LoadingRowRendererFn>
- The row renderer for when that row is currently being loaded.
Defaults to
DefaultLoadingRowRenderer
. For a full example see the custom_renderers_svg example.
- The row renderer for when that row is currently being loaded.
Defaults to
- error_row_renderer:
impl Into<ErrorRowRendererFn>
- The row renderer for when that row failed to load.
Defaults to
DefaultErrorRowRenderer
. For a full example see the custom_renderers_svg example.
- The row renderer for when that row failed to load.
Defaults to
- row_placeholder_renderer:
impl Into<RowPlaceholderRendererFn>
- The row placeholder renderer. Defaults to
DefaultRowPlaceholderRenderer
. This is used in place of rows that are not shown before and after the currently visible rows.
- The row placeholder renderer. Defaults to
- row_class:
impl Into<Signal<String>>
- Additional classes to add to rows
- thead_class:
impl Into<Signal<String>>
- Additional classes to add to the thead
- thead_row_class:
impl Into<Signal<String>>
- Additional classes to add to the row inside the thead
- tbody_class:
impl Into<Signal<String>>
- Additional classes to add to the tbody
- loading_cell_class:
impl Into<Signal<String>>
- Additional classes to add to the cell inside a row that is being loaded
- loading_cell_inner_class:
impl Into<Signal<String>>
- Additional classes to add to the inner element inside a cell that is inside a row that is being loaded
- sorting: [
impl Into<RwSignal<VecDeque<(usize, ColumnSort)>>>
](RwSignal<VecDeque<(usize, ColumnSort)>>)- The sorting to apply to the table.
For this to work you have add
#[table(sortable)]
to your struct. Please see the simple example.
- The sorting to apply to the table.
For this to work you have add
- sorting_mode:
SortingMode
- The sorting mode to use. Defaults to
MultiColumn
. Please note that this to have any effect you have to add the macro attribute#[table(sortable)]
to your struct.
- The sorting mode to use. Defaults to
- on_row_count:
impl Into<EventHandler<usize>>
-
This is called once the number of rows is known. It will only be executed if
TableDataProvider::row_count
returnsSome(...)
.See the paginated_rest_datasource example for how to use.
-
- reload_controller:
ReloadController
-
Allows to manually trigger a reload.
See the paginated_rest_datasource example for how to use.
-
- display_strategy:
DisplayStrategy
-
The display strategy to use when rendering the table. Can be one of
Virtualization
InfiniteScroll
Pagination
Please check
DisplayStrategy
to see explanations of all available options.
-
- loading_row_display_limit:
usize
- The maximum number of loading rows to display. Defaults to
None
which means unlimited. Use this if you load a small number of rows and don’t want the entire screen to be full of loading rows.
- The maximum number of loading rows to display. Defaults to
- row_reader:
RowReader<Row>
- Provides access to the data rows.
- _marker: [
PhantomData<(Err, ScrollM)>
]