Restrict selection in datagrid based on the attribute value

0
I use simple multi select in my datagrid. On that I want to select and delete the objects from the Entity. But the selection should be done only based on the attribute value of the object in each row.  For example, I have an boolean attribute in my entity, if the attribute is true I should be able to select the row else  I should not be able to select that particular row like disabled. Thank you in advance.
asked
1 answers
0

The behaviour you describe is not supported by default. And i doubt if users would find it user friendly if they see a record in the grid but are not able to select that record.

Options i see:

  1. Create a microflow action to do the delete. In this action you filter the selected items based on the the boolean and delete only the records with the correct value, or you check if records were selected with the “wrong” value and in that case present a blocking error to the user.
  2. Create a separate grid containing only the records with the correct setting of the boolean and only present the delete-function there.
  3. … 

 

There are probably some other solutions i did not think of. In general: it is almost always the best strategy to go with what Mendix offers out of the box and not create custom widgets for this type of behaviour.

answered