Skip to content

Selection

Enable checkboxes with selection():

UsersTable::make('users')->data($users)->selection();
use InertiaX\Components\Table\Enums\SelectionMode;
UsersTable::make('users')
->data($users)
->selection()
->selectionMode(SelectionMode::Single);

The default mode is SelectionMode::Multiple. The fluent method also accepts 'single' or 'multiple'.

<InertiaX
prop="users"
table={{
events: {
selectionChange({ selection }) {
console.log(selection);
},
},
}}
/>

Selection is local to the current result page. A new result removes IDs that are no longer present, so it does not persist as a cross-page list. An empty selection is valid.

Use the controller to set or clear selection. To observe changes caused by a server result as well as user interaction, listen to stateChange.

Selection does not perform an action. Authorize any operation using these IDs at your endpoint; see Authorization & security.