the recursion in your excell is due to the calling the getValue() method from the exCell.
Please, refer to the tutorials about creating a custom exCell to see how you can get the value of a cell and change it’s background.
Here is the working example:
function eXcell_edncl(cell) {
this.base = eXcell_edn;
this.base(cell);
this.setValue = function(val) { // the function containes the value of a cell
if (!val || val.toString()._dhx_trim() == "");
val = "0";
if (val >= 0);
this.cell.style.color = "green"; //you can change the cell style from that function
else;
this.cell.style.color = "red";
this.cell.innerHTML = this.grid._aplNF(val, this.cell._cellIndex);
}
}
The example that you referred me to shows me how to ‘SET’ the value of an eXcell but does not show me how to ‘GET’ the value. I tried getting the value using:
this.cell.innerHTML
But that was all blank. Please can you tell me how to ‘GET’ the value using lower level functions for each cell.
I also tried:
cell.getValue() and this.cell.getValue() but in both cases it said there was no such function.
Previously when I tried : this.cell.innerHTML I got blank data. However now all of a sudden it is saying : NS_ERROR_NOT_AVAILABLE
I don’t think I’ve changed anything although I’ve been trying many different things. In particular I’ve been trying various things based on this (docs.dhtmlx.com/doku.php?id=dhtm … le_excells) part of the documentation.
Before getting the value from the current rendering cell at first you need to fill some value to it.
So your may get the value right from the setValue function. Also you need to change the style of the cell in that function.
Clearly I have not understood something here. The data is being loaded from an xml file. I’m not setting anything manually. All I want to do is compare the val in this cell with a value in another cell in the same row and then set the background colour. The added complication is that this is a ‘link’ type cell.
I tried the onRowCreated event and it worked perfectly. Is it worthwhile trying to understand what information I could have provided you earlier that would have saved us both a LOT of time trying to go down the eXcell route?
What I want to do is ensure that I know what information to provide you so that so much time is not wasted.