Tuesday, August 23, 2011


Introduction :
This post to describe how to show a unsaved row of a table. There is a property of an entity which is entity state. This entity can be in 4 states:
  1. New
  2. Modified
  3. Unmodified
  4. Initialized

How to do it :
just copy the following code and paste in to inline style of column of table. This will highlight newly created row.

#{row.row.entities[0].entityState == 0? 'background-color:#ff9c31;':''}

To highlight modified row compare entity state to 2

0 for new unsaved row
1 for unmodified row
2 for modified unsaved row
-1 for initialized row

for showing unsaved rows whether modified or a new place both condition together. 

#{row.row.entities[0].entityState == 2||row.row.entities[0].entityState == 0?'background-color:#ff9c31;':''}

No comments:

Post a Comment