Dhtmxgrid button

Hi,

I have the following code, however when I try to get the “checkvalue” it is always empty string ? Why ?
function eXcell_button(cell)
{
if (cell)
{
this.cell = cell;
this.grid = this.cell.parentNode.grid;
}
this.setValue=function(val)
{

    var row_id=this.cell.parentNode.idd;
    var checkvalue = mygrid.cells(row_id,2).getValue();
	if(checkvalue == "O2") {
	    
    var value = "some input";
	} else {
	    var value = "diff input ";
	}
 
    this.setCValue(value);
}
this.getValue=function(val)
{
    var row_id=this.cell.parentNode.idd;
    alert("hersda");
   return value;
}

}
eXcell_button.prototype = new eXcell;// nests all other methods from the base class

This line just calls getValue of excell object for the target cell.

mygrid.cells(row_id,2).getValue();

If it one of default cell types, check that target cell really does have some value
If this is a custom excel, check its getValue method.