mygrid.cells(i,1).getValue is not working sometimes

I had an issue in the data grid, I used following code to avoid duplicate entry in grid that code i have pasted below,

function addRow(){

    var pcode = document.getElementById('ProdCode').value;
 
    var tRows = mygrid.getRowsNum();
    var i = 1;
    var goAhead=true;
   
    for (i;i<=tRows;i++){

        if (mygrid.cells(i,1).getValue()==pcode)
        {
            goAhead=false;
        }
    }
   
   
    if (goAhead==false)
    {
        alert(pcode + ", already entered");
        return false;
    }
   
    if(window.XMLHttpRequest)   
    {
        reqObj=new XMLHttpRequest();
    }  else
    {
        reqObj=new ActiveXObject('Microsoft.XMLHTTP');
    }
   
    var queryString = '?id=' + pcode + ;
   
    reqObj.onreadystatechange=processNewRow;
    reqObj.open('POST','./getGridData'+queryString,true);
    reqObj.send(null);

}

function processNewRow(){

    if(reqObj.readyState==4)
    {   
         csvstr=reqObj.responseText;
            mygrid.parse(csvstr,"csv");
    }

}

My problem is, mygrid.cells(i,1).getValue() It recognized only the first click. Subsequent events it fails to trigger the function.

this works fine in firefox but in IE 6&7 it gives an issue like after 1 or sometimes 2 click the function does not get called.

Please kindly help me

Unfortunately the issue cannot be reconstructed locally.
Please, provide us with a complete demo where the issue can be reproduced.
Here you can find a tutorial:
docs.dhtmlx.com/doku.php?id=othe … leted_demo