Synphonyte / leptos-struct-table

Easily create Leptos table components from structs
Apache License 2.0
154 stars 23 forks source link

Feature: Add the choices for sorting #10

Open ycuk opened 11 months ago

ycuk commented 11 months ago

Sometimes table data may be a small and in that case we dont want to make request to server again just for sorting for a few rows. So I think it would be good option to select sorting side when use TableDataProvider.

Something like this:

pub enum SortingSide {
    Client, // local sorting
    Server, // server sorting
}

#[async_trait(?Send)]
impl TableDataProvider<T> for MyDataProvider {
    type ColumnName = MyColumnName;
    type SortingSide = SortingSide::Client;

    ...
}