Added table function for generic table view creation
This commit is contained in:
parent
dd9d1c0c2f
commit
2401c2a4ec
3 changed files with 17 additions and 3 deletions
|
|
@ -316,6 +316,7 @@ pub use spin_button::{spin_button, vertical as vertical_spin_button, SpinButton}
|
|||
pub mod tab_bar;
|
||||
|
||||
pub mod table;
|
||||
pub use table::table;
|
||||
|
||||
pub mod text;
|
||||
#[doc(inline)]
|
||||
|
|
|
|||
|
|
@ -18,3 +18,16 @@ pub type SingleSelectModel<Item, Category> = Model<SingleSelect, Item, Category>
|
|||
pub type MultiSelectTableView<'a, Item, Category, Message> =
|
||||
TableView<'a, MultiSelect, Item, Category, Message>;
|
||||
pub type MultiSelectModel<Item, Category> = Model<MultiSelect, Item, Category>;
|
||||
|
||||
pub fn table<'a, SelectionMode, Item, Category, Message>(
|
||||
model: &'a Model<SelectionMode, Item, Category>,
|
||||
) -> TableView<'a, SelectionMode, Item, Category, Message>
|
||||
where
|
||||
Message: Clone,
|
||||
SelectionMode: Default,
|
||||
Category: ItemCategory,
|
||||
Item: ItemInterface<Category>,
|
||||
Model<SelectionMode, Item, Category>: model::selection::Selectable,
|
||||
{
|
||||
TableView::new(model)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue