Accessing internal functions via JavaScript

Hi,

I am using some commonbehave.htc functions to improve my application, and at some point of my code I need to access every cell and, if my function returns false then I must set the background of the current cell with the red "X"s.

My app uses the following code:

var maxr = GridWeb1.maxrow;
var maxc = GridWeb1.maxcol;
var errors = 0;
for (var line = 2; line<=maxr; line++)
{
for (var column = 2; column <=maxc; column++)
{
var cell = GridWeb1.getCell(line, column); // get the object of the cell
var testing = detecta(cell,false); // this function checks the contents of the cell
if (!testing)
{
errors++;
GridWeb1.setInvalid(cell); // set the background of the cell with red XXX.
}
}
}
alert ('Number of Errors='+errors);

But, when I run this code, the setInvalid function throw this error:

Error: Object doesn't support this property or method

Do you have any idea of what can I do to fix it?

Thanks in advance,

Rudolf Gütlich
Delsis Eng. Sistemas

Hi,

I solved the problem adding " to the commonbehave.htc!

Thanks!

Hi,

Thanks for sharing.

I think you may also use a CustomFunction Validation for each cell you want to check. The grid will call the specified js function and set the invalid mark automatically after editing the cell or before submiting.