Color coding text value in an onChangeCell client event?

I know that I can use a Server onAfterGet method to set the css property to change the color of cell text or cell background color in a relationship grid. But I would like to immediately highlight a data entry error that fails validation by highlighting the cell in a different color (red text, for example). I would rather not pop up an alert..

I have set up an onChangeCell client (JavaScript) event on the property, and tried using this code:

var val = gridApplet.GetCellValue(relationshipID, colNumber);
if (val < 0) {
gridApplet.SetCellTextColor(relationshipID, colNumber, "#FF0000");

But the SetCellTextColor call triggers a Dojo error, with details like: Invalid item argument.

Any suggestions to allow this to work?



  • Not sure if you can relationshipID to specify the target row. For quick and dirty testing, will this one color anything?

    var rowId = gridApplet.getSelectedId();
    gridApplet.SetCellTextColor(rowId , colNumber, "#FF0000");

    Well, probably relationshipID is the same then getSelectedId, so it will probably not work. 

    Haven´t seen a lot samples regarding this one. How do you call your gridApplet?

  • Hi,

    I right now want to do a similar coloring with a onChangeCell event. I also got the above error message and Google brought me back to this forum post. My previous answer was no big help. Has anyone found a solution for this one?