marimo icon indicating copy to clipboard operation
marimo copied to clipboard

mo.ui.table, allow disable selection for some rows.

Open Eloitor opened this issue 1 year ago • 4 comments

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 avatar Jul 02 '24 18:07 Eloitor

@Eloitor you could again use mo.state and track the selection and put up a warning (mo.callout) when there is an invalid selection

mscolnick avatar Jul 02 '24 23:07 mscolnick

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 avatar Jul 03 '24 05:07 Eloitor

@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?

ghost avatar Aug 01 '24 08:08 ghost

I want to use the valid combinations as inputs for my notebook.

Eloitor avatar Aug 01 '24 08:08 Eloitor