diff --git a/docs/src/pages/components/DataTable.svx b/docs/src/pages/components/DataTable.svx index 784002f5..059c7e2d 100644 --- a/docs/src/pages/components/DataTable.svx +++ b/docs/src/pages/components/DataTable.svx @@ -1115,6 +1115,16 @@ Use the `selectedRowIds` prop to specify which rows should be selected. +### Batch selection with controlled toolbar + +By default, `ToolbarBatchActions` is activated if one or more rows is selected. Clicking "Cancel" will deactivate it. + +Use the `active` prop to control the toolbar. Note that it will still activate if one or more rows are selected. + +You can also prevent the default "Cancel" behavior in the dispatched `on:cancel` event. + + + ### Selectable (radio) diff --git a/docs/src/pages/framed/DataTable/DataTableBatchSelectionToolbarControlled.svelte b/docs/src/pages/framed/DataTable/DataTableBatchSelectionToolbarControlled.svelte new file mode 100644 index 00000000..08e5981e --- /dev/null +++ b/docs/src/pages/framed/DataTable/DataTableBatchSelectionToolbarControlled.svelte @@ -0,0 +1,63 @@ + + + + + + + + + + + +