-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip columns based on an enum #58
Comments
Something more generic can be used here, e.g. a signal or a callback function to decide which columns to show/hide. What do you think? |
I totally agree. I'd like to have an integrated solution with re-ordering columns. Maybe have a RwSignal<[ColumnConfig; <col_count>]>
struct ColumnConfig {
order: usize,
visible: bool,
} What do you think? |
The really generic solution would be for the library to generate an enum for the row structure (value for each field, except those marked E.g.
and then take signal (maybe something like
Using It looks like a similar feature was already suggested in issue #13 using strings.
Using something like additional functionality:
Using callback does not seem worth it. Signal of vector seems more composable (e.g. derive it from multiple signals from bool signals from checkboxes, or by concatenating two smaller vectors for configuring parts of the table,..). (I have very limited knowledge of Rust macros, therefore no idea about the implementation difficulty or language-imposed limits for doing this) |
I did sth like that in an earlier iteration but for me that is too much magic and doesn't seem necessary. I'd like to keep it as lean as possible while still providing all the functionality. You already can sort of switch renderers at runtime. In your custom renderer you can do whatever you want. |
Data which represent a relation are often displayed in multiple places, but often without a column representing one side of the relation.
Example:
(assume that
AppRoute
type implementsleptos_struct_table::CellValue
to render a hyperlink)driver
detail page, it is useful to display the table withoutdriver
column (all values are same, all link to thedriver
detail page itself).car
detail page, it is useful to display the table withoutcar
column (all values are same, all link to thecar
detail page itself).driver
andcar
columns are displayed.Current solution is to duplicate the table as
RoadTripRowFromDriver
andRoadTripRowFromCar
, and delete (or#[table(skip)]
) one row in each copy.It works, but maintenance is not ideal. With more relations in the system, it requires extra effort to keep all three table structures (for every relation) in sync,
It would be nice improvement, if something like the following were possible:
The text was updated successfully, but these errors were encountered: