cell template refresh

I have a cell template for setting the background color of a cell based on the contents of another cell in that row. I would like the color to change for that cell when the other cell is edited, and here I am stuck.

if (this.getCellProperty("class") == "critical")
return "#F95757";
function cellClass(i,j)
{ .... return newclass; }

In the onCellValidating function I call:


but the color does not change to correspond with the new entry. (It shows correctly when I refresh the whole page.)

Any ideas greatly appreciated.
March 15,

This is the statement that does not seem to have any effect. Does anyone know why? I need to re-paint a cell based on a new grid entry.
March 16,
did you try render()?
March 17,
Thanks, but I don't know what that is a method of ... ?
March 17,
Have you tried this?
instead of:

March 18,
Thank you for that suggestion ... still same effect tho.

Have to page down and then page up to see the new color. :-(
March 18,
Sorry for suggest to test and fail again, but...
and this one?
March 18,
Thanks so much for another suggestion ... this does not refresh either, but I was very hopeful. :-) Is there any resolution? This is happening under IE 7 and IE 6.

Does anything work for anybody, in doing an immediate cell-repaint, called from the onCellValidating function?
March 19,
I am still trying for a solution for this. I have a cell template for setting the background color of a cell:


My problem is having the cell template refresh when cell contents change. It seems the only way this will happen is with a complete browser refresh. Without that, even when I re-load my data, setCellData to the new array, and refresh the grid, the cell color will not change unless I physically page down till the cell is out of view, and then page back up.

Along with the grid refresh, I've tried:


but it does not repaint the cell. Am I missing something? Any ideas very much appreciated.
April 16,
If I'm not too much mistaken, after reading a few (onCellValidating) posts like:
It seems that templates work the same as reverting values, and must be done using onCellValidated event instead ( just to prevent the editing part already finished).
But, as I am not totally sure ( never tried to refresh templates on validating) I would also give a try to some timeout or even refresh the full row (better than full grid/page).
April 16,
Carlos, thank you so much for your help with this. It works! I use


in the onCellValidated event, and it does just what I want, and I don't even have to refresh the full grid. Refreshing the row rather than the cell was important, because the cell template was based on another value in that row, which changed as a result of the edit.

Thank you very VERY much. :-)
April 18,

This topic is archived.

See also:

Back to support forum