onRender()

Hi,

How can I check the read only state of a column in table view form in the onRender() event handler starting with the event parameter?

I am converting onRowBGCalculation() to onRender().
Oh, I am using the onRender()-event on form level.

You could do something like this:

	if (event.getRenderable().getName() && elements[event.getRenderable().getName()].readOnly) {
		event.getRenderable().bgcolor = '#ff0000';
	} else {
		event.getRenderable().bgcolor = '#00ff00';
	}

Always be careful when using onRender, it will be called a lot of times.

Thanks Joas!

I was trying to write a generic onRender() handler outside the form with only the event parameter as parameter.
There is regrettably no handle grip in the JSRenderEvent to the calling form (and form elements) I am aware of.

I think I should use form inheritance probably…

Regards,

please be aware that all this kind of code using onrender will not work for NGClient so it is not something that can be used to move forward

Okay, can this be styled then in Smart- and NG-client?