marimo
marimo copied to clipboard
mo.ui.table, allow disable selection for some rows.
Description
I have a table that contains some parameters to be used for the rest of the notebook. Selecting one row, sets up the parameters.
Under some conditions, some combinations of parameters are not valid for the calculations I want to do.
Suggested solution
Allow disabling the selection of some rows, while displaying them.
Maybe in gray to show they are not available?
Alternative
No response
Additional context
No response
@Eloitor you could again use mo.state and track the selection and put up a warning (mo.callout) when there is an invalid selection
The disabled rows would make it more obvious.
Maybe passing a lambda to mo.ui.table that returns true if the row should be enabled, and false if it should be disabled.
@Eloitor How about validating the combinations of parameters before passing them to the table?
Do you need to include these invalid combinations in the table? For instance, you need to compare the differences between valid and invalid combinations, or you want to see some summaries of all combinations?
I want to use the valid combinations as inputs for my notebook.