Row based write permission
Row based write permission
jbronikowski
Posts: 7Questions: 4Answers: 0
We have a scenario where we want to display all rows for users with the ability to edit based on the data within the row. If the row contains Apple we want to be able to edit it. If the row contains anything else, we do not want to be able to edit it.
Example below
Row 1 - Permission Level(Apple) - Data
Row 2 - Permission Level(Orange) - Data
Row 3 Permission Level (Admin) - Data
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The way to do this is with a custom button. In the button's
init
function you would listen for theselect
event, which let's you enable or disable the button using the API (button().enable()
).In the simplest use case you would just enable or disable if there are any rows selected (which is what the built in button types for Editor do). In your case you would need to get the data from the selected row and decide if it should be enabled or not, based on whatever logic you need.
You should also listen for
deselect
so you can disable the button when there is nothing selected.Allan