Editing Perspective Table field committed edit value without privilege shows edited value until field is unselected

A screen capture tells 1000 words...
P Table Checkbox

The "Gas Control Enable" column has editing enabled, however it checks if the user has privilege before writing the value to the tag.
If they don't have privilege, then a warning shows, but the checkbox remains superficially checked until the row selection is changed, whereupon it reverts back to its actual value. This is what I'm trying to fix.

I've tried writing the table.props.selection fields (selectedRow, selectedColumn, data) to blanks (None, None, and []), however this doesn't seem to have any effect. I've also tried refreshing the props.data binding after blanking the selection props, and after a short time.sleep delay (sometimes I've found this is needed). All without success, the row and field remain selected and the checkbox remains checked/in the wrong state until the selection is manually changed.

I'm not sure how else to try to fix this. Any ideas?

I've also tried setting the focus to something else, but the selection remains unchanged.

Maybe a "deselect" method could be added to the Perspective Table component?

Hmmm. I would consider it a design error to allow the editing to get to the checked state. :man_shrugging:


This was actually my "work-around", to disable "editable" if the user doesn't have the privilege.
What I normally do is disable the component and display a "no privilege" icon with a tooltip, inside the component e.g. a button. But in the case of a table, it's not so easy, and I want to avoid using any embedded views for performance.

What's also a bit average, is having to click into the field to enable editing, and then clicking again to actually toggle the checkbox. Although for mobile, this might be good

1 Like