Hello everyone, I’m looking for a method that can add event button as control bar in Datagrid2. For example: I have a list of object that is display in Datagrid2, for each record I add a checkbox. I want to add a button “Delete” that will delete all checked record. When I use Datagrid, it has a control bar that allowed me to add button action for microflow. However, I cannot find that settings in Datagrid2 I had tried searching information on the Mendix document about Datagrid2 but there is no information about it. https://docs.mendix.com/appstore/modules/data-grid-2/ Does anyone have experience about this issue? Updated: Added a microflow for deleting selected objects. However, I cannot pass the list object in Datagrid2 as a parameter to the microflow.
Pham Minh Chau
Hi Pham Minh Chau,
You could have the checkbox being a Boolean attribute in your datagrid entity. When you check the checkboxes, the value of the checkbox boolean becomes true. When you eventually press the delete button, you call a microflow that deletes all the entities with checkbox true.
Create a boolean attribute in the entity and set it as attribute for the checkbox
Creat for the OnClick event of the delete button a Microflow
In the Microflow retrieve a list with object that have the checkbox attribute on true.
Run a Delete activity for that list, so the objects will be deleted.
(make sure you enable ‘refresh in client’ to directly see the delete results.)
Hope this will help you toward you goal. Good luck,