Closed sho-87 closed 8 months ago
so after messing around with this a bit more, it seems the problem is with WithColumns(generateColumns())
.
this works correctly if I remove that call, but shouldn't the select column be automatically added even if I respecify which columns are displayed?
The simple answer to your original question: this is a bug. The selected text column should properly persist after WithColumns
is called again. I can reproduce this locally, and this should be fixed.
The more specific answer to your particular case is that you shouldn't need to call WithColumns
if your columns aren't changing. The columns alone should persist.
Interestingly, I'm also realizing now that the select functionality won't persist after WithRows
is called, because it doesn't know which new row corresponds to an old selected row. That may need some further thought, and if you need this functionality let's open a new issue. This issue will just be scoped to fixing the disappearing column, I just wanted to point that out as a potential followup.
Whoops, I didn't mean to let it autoclose. I'll let you close this if you consider it fixed, or I'll close it myself later if there's no reply for a bit. Released as v0.15.7, using WithColumns
and SelectableRows
should properly keep the selected column in place after changing columns.
That being said, you shouldn't need to use WithColumns
in your given example, so you may want to get rid of it anyway unless you really are changing columns around on the fly.
just tried it out and it works great, thanks for your speed!
In the features example, there is a column that shows automatically to indicate which rows the user has selectable. As I understand, that column does not need to be manually specified - you simply set
SelectableRows(true)
on the model. I'm trying to get that column to display when the row data is being dynamically populated.The table is created like this:
In the initial state where
rows
is empty, the selected column displays correctlyBut I have a keybinding that lets the user regenerate the rows when
m.projects
data is updated:When that happens, the table updates with the correct data but the select column is no longer visible
Is there something special that needs to be done when the rows are being updated/replaced using
WithRows()
? I couldn't find anything in the documentation about this as it seems everything related to the select column is handled automatically under the hood