Skip to main content

TableModifiers

Trait TableModifiers 

Source
pub trait TableModifiers<Id, K = String>: Sized
where K: Clone + PartialEq + Send + Sync + 'static,
{ // Required methods fn sort_state( self, sort_state: impl Res<Option<TableSortState<K>>> + 'static, ) -> Self; fn resizable_columns<U: Into<bool> + Clone + 'static>( self, flag: impl Res<U> + 'static, ) -> Self; fn sort_cycle<U: Into<TableSortCycle> + Clone + 'static>( self, cycle: impl Res<U> + 'static, ) -> Self; fn selectable<U: Into<Selectable> + Clone + 'static>( self, selectable: impl Res<U> + 'static, ) -> Self; fn selection_follows_focus<U: Into<bool> + Clone + 'static>( self, flag: impl Res<U> + 'static, ) -> Self; fn selected_row_ids<R>( self, selected_row_ids: impl Res<R> + 'static, ) -> Self where R: Deref<Target = [Id]> + Clone + 'static; fn on_sort<F>(self, callback: F) -> Self where F: 'static + Fn(&mut EventContext<'_>, K, TableSortDirection) + Send + Sync; fn on_row_select<F>(self, callback: F) -> Self where F: 'static + Fn(&mut EventContext<'_>, Id); }
Expand description

Modifiers for configuring controlled table state and callbacks.

Required Methods§

Source

fn sort_state( self, sort_state: impl Res<Option<TableSortState<K>>> + 'static, ) -> Self

Sets the current sort state.

Source

fn resizable_columns<U: Into<bool> + Clone + 'static>( self, flag: impl Res<U> + 'static, ) -> Self

Enables or disables column resizing for all columns.

Source

fn sort_cycle<U: Into<TableSortCycle> + Clone + 'static>( self, cycle: impl Res<U> + 'static, ) -> Self

Sets the sort cycle behavior for sortable columns.

Source

fn selectable<U: Into<Selectable> + Clone + 'static>( self, selectable: impl Res<U> + 'static, ) -> Self

Sets the selectable state of the table rows.

Source

fn selection_follows_focus<U: Into<bool> + Clone + 'static>( self, flag: impl Res<U> + 'static, ) -> Self

Sets whether selection follows focus.

Source

fn selected_row_ids<R>(self, selected_row_ids: impl Res<R> + 'static) -> Self
where R: Deref<Target = [Id]> + Clone + 'static,

Sets externally controlled selected row ids.

Source

fn on_sort<F>(self, callback: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>, K, TableSortDirection) + Send + Sync,

Sets the callback triggered when a header requests sorting.

Source

fn on_row_select<F>(self, callback: F) -> Self
where F: 'static + Fn(&mut EventContext<'_>, Id),

Sets the callback triggered when a row is selected.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, V, Id, K> TableModifiers<Id, K> for Handle<'_, Table<T, V, Id, K>>
where V: Deref<Target = [T]> + Clone + 'static, T: PartialEq + Clone + 'static, Id: PartialEq + Clone + 'static, K: Clone + PartialEq + Send + Sync + 'static,