Hide columns in Data grid

0
Hi friends, I am trying to configure a data grid with four columns. Second column contains a drop down field with Yes/No values. Here, I am having a condition that, according to the second column field for eg: No, the next two column values should be disabled. Is this possible in mendix? Thanks in advance...
asked
5 answers
2

Hello Vatsalya,

You could try to use a list-view instead. Then you have more control about conditional visibility and conditional editability. In you case with a data-grid, you must apply enhanced entity access rules. So, for example the following two rules could be applied.

  1. When yes -> apply read/write to the next two attributes in the grid
  2. When no -> apply read (or none) to the next two attributes in the grid

I'm not sure if a data-grid is hangling this very well though.

Kr, Bart

answered
2

You could also upvote this request on the Q1 2016 idea forum. Suggested by Wouter Visser.

answered
0

Bart is on the right track with the list view as it allows for far more configurability. However, you might want to consider using conditional visibility based on the attribute being changed rather than poking around in the complex world of access rules.

Using attribute conditional visibility is as simple as adding columns three and four twice. One set contains editable widgets and is visible when drop-down value is x and the other contains the same widgets with editability set to false and is visible when drop-down value is y.

The access rule option would entail adding an extra module role to the entity module. That role should be identical except that it allows only read access instead of read/write access. You then need to add an xpath to the role that read [dropDownValue = true()], or something along those lines.

answered
0

You could look at the logic behind the Data Grid Extension (Flex Headers) in the Appstore and work it out from there.

answered
0

Thanks to all for your answers. It helped me alot.

answered