TemplateGrid styling of an attribute based on value

0
Hi, In a templategrid, is there anyway to style a particular field depending on it's value? We can add easily a class or style to the field, the problem is that when you look at the html code generated, the value is not there. The only thing you see is: <input class="templatesystemTemplateGrid_textBox activationStatusInput" name="activationStatus" readonly=""> How can we get the value? Regards, Philippe
asked
2 answers
4

I developed a widget for that purpose. It uses a second attribute as class. So you can change the background color, font, images etc with a class. Available here

answered
0

Phillippe,

You can add classes to elements in the Modeler. Doing this conditionally in a TemplateGrid is a bit tricky, but I think the following might work:

  • Create a form with a dataview of the entity that you want to display
  • In this form, make table rows that are conditionally visible based on attribute values of the object
  • place the fields you want in the table rows and associate classes or styles with them to achieve the look and feel that you want
  • Now on the original form - the one with the TemplateGrid, use the FormLoader widget from the appstore inside of the templategrid and have it load the form you just created

The reason FormLoader is needed is that TemplateGrid won't allow conditional row visibility

Hope that helps,

Mike

answered