Visibility on delete button in datagrid.

0
Hi members, I read that it is not possible to play with the visibility or use dynamic classes on buttons in a data grid, like the delete button. Only in data view and listview etc.. I want based on an attribute of my object make the delete button invisible. Is there any workaround? I read something about an extra non persistable entity but that seems complicated. https://forum.mendix.com/link/questions/104357   Thank you!
asked
1 answers
0

You can use conditional visibility and dynamic classes, but not based on attributes of the grid entity, only based on a page parameter or containing data view if there is one.

You could show buttons conditionally inside a listen-to dataview that appears like a toolbar above the grid, but if you have search fields etc. above the grid you’ll need to put your custom toolbar above those too, or mess around with javascript.

You could also create a delete microflow and add a toolbar button to invoke that instead of a default delete action, and check in the microflow if the object may be deleted or not. If so, delete the object with a refresh, if not, show a message. Not as user friendly of course, as the button will always be available, but still an improvement.

answered