Forum Discussion

shwnhlgn's avatar
shwnhlgn
Ideator III
9 years ago

Color Coding Null Data Fields

Would like to highlight certain data fields that are null for a specific ItemType. Does anyone have a solution? Or maybe can point me to the correct method(s) used on the project function for color coding project status?  

4 Replies

  • Hi, On an "afterGet" event you can attach a server method which will change you result. Let's say you have a property called "internal" which you want to color in red if the value is null or undefined. Looping through the query resulting items you would then do : if (iterItem.getProperty("internal","null")=="null"){ string specificCss= ".internal { background-color: #F00; }" ; iterItem.setProperty("css",specificCss); }
  • I would like the color coding to be on a field in a related item, and not a parent. Should I put this server method on the parent item, and query the related item and then attach the above solution. Or should I put the method directly on the related item?  
  • I would say it would be better to do it on the related item. if it is a classic Relationship and you do it on an onAfterGet, then you will have the coloring one every usage of this related item. So it is up to you if you'd prefer doing it on the Relationship onAfterGet event. Let us know if that's not clear. ;)
  • It looks like the method is working fine and applying the background color command to the Item css field. But how does that translate to the specific field css? (in the case above actually turning "internal" red) If this is a simple question, could you please point me to some resources.