onRender Event usage

I’m trying to play around with the onRender event and am having some issues.

I followed this thread
http://www.servoy.com/forum/viewtopic.php?f=1&t=15873&p=85598&hilit=onrender+example#p85598

I assume some usage must have changed as when I copied this over into 6 Beta 1 it told me some of the functions were depreciated.

I also noticed in the example that it called fields directly by using

var _rec = event.getRecord();
var _isSelected = (_rec.selection_calc == 1);

When I try to use the “_rec.MYFIELDNAME” it doesn’t work.

What I am trying to do is I have a table view with several records. I want to change the border of a field if another field in the record is empty.

Thanks

you can test for data dynamically:

var _rec = event.getRecord();
if (_rec['columnname'] != null) return xxxx
else return yyyy

or you could cast the record to it real db type:

/** @type {JSRecord<db:/servername/tablename>} */
var _rec = event.getRecord();
if (_rec.columnname != null) return xxxx
else return yyyy

Thank you!

I tried the first method and it worked fine.

I will post back if I run into any more issues.

-Bryant