Newbie label question

Ok this seems like a really silly question but if I want a label to change colour dependant on a table field value and for this to happen when the user moves through the table where do I put the code :? .

In foxpro it would go in the forms Refresh method but Servoy doesn’t appear to have one! Am I missing something simple??
Many thanks
Caroline

In Servoy you can use the onRender event of your form for this. Attach a method like this:

function onRender(event) {
	/** @type {JSRecord<db:/example_data/orders>} */
	var _orderRec = event.getRecord();
	var _element = event.getRenderable();
	
	if (_orderRec && _orderRec.is_paid) {
		_element.bgcolor = "#00ff00";
	} else {
		_element.bgcolor = "#ff0000";
	}
}

And for coloring the row tables you can put this in your style file

odd {
	background-color: #ffffff;
}

even {
	background-color: #edf3fe;
}

selected {
	background-color: #5C86DF;
}

Many thanks Joas that worked a treat :D .