Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Cell Coloring Cell Based On Another Cell


We have a case where we are color coding cells on a grid based on a query that runs an xAcute transaction that is relatively slow.

We are coloring cells based on values of other cells. For example, we may want to highlight a Part Number in red when the part number cannot be found in another system. The value of the part number cell does not determine the color but we have another hidden column that tells us whether or not to hightlight the cell.

We did not see a way to acheive this use the Display Template's Color Context tab. We are doing the color coding in JavaScript.

How can we guarentee that the applets query is finished before we attempt to do the color coding? The best we know to do at this point is to turn OFF the initial update of the grid and, in a body onload JavaScript function, call refresh() on the applet and then do our color coding.

Is there a better way to do this? I wish there was a way to handle this in the Display Template but we don't see a way to color a cell (not a whole row) based on the value of another cell.

Thanks in advance.




The iGrid's UpdateEvent will be fired each and every time the underlying query has been run and 'painted' into the applet. The FirstUpdateEvent (immediately followed by the UpdateEvent) will fire only once upon the initial applet rendering with query data, and is a proper trigger point to use instead of the body onload.

Easy way to see how they work is to declare them in your applet parameters and then put a corresponding alert message in the functions. The nice thing is that the modal alert dialog will pause the activity so you can see it developing.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question