Grey out specific rows in a list view based on an attribute value?

0
Hi guys,  I am using a list view to display lines from a code of conduct, where each row in the list view also contains a few action buttons (such as 'Complete Control Assessment'). I would like to 'grey out' certain lines of the list view based on an attribute value ('business type') so that the user is still able to read the line but it is clear that the specific line is not applicable to their business and no action is needed. I understand it is possible to hide certain lines based on an attribute value, but what about 'greying out'?  Further from this, I would also like there to be a button in the greyed out row which you can select in order to 'override' the pre-populated applicability of the line, add some text to justify why you want to override the applicability of the line, and then have the line formatting change back to 'white' so that you are able to access the action buttons.  If you are able to help with one or both of these questions that would be great! Thank you in advance. 
asked
2 answers
1

You can hide or 'grey' out attribute based on a condition, see: https://docs.mendix.com/refguide6/conditions

In your case making a attribute not editable based on the attribute 'business type', will result in an 'grey' attribute which is not editable.

As to the button, you can add a button in the listview that is visible based on the 'business type' attribute. Behind this button you can add logic with for example a pop-up to add some text and after this change the 'business type' attribute in order to make the line editable again.

answered
0

You could consider using conditional visibility to show one of 2 containers based on the 'business type'. One of the containers would be styled normally, and the other could be styled grey. Only one of the 2 containers would ever be visible at any given time, so the end user would see only the correct styling for that row.

You could also place a button in the 'grey' container that inverts the visibility condition and also shows a comment box, perhaps by flipping a boolean on the row object.

answered