This is my code to get implement the refresh after updating the values.Please suggest is any thing went wrong.
function doOnCellEdit(stage,rowId,cellInd)
{
if(mygrid2.getSelectedCellIndex()==3)
{if(stage == 2)
{
//alert(‘in stage 2’);
var a = mygrid2.getSelectedId();alert(‘index’+a);
var b = mygrid2.getRowId(a);
var roomWith= mygrid2.cells2(b,1).getValue();
var comments= mygrid2.cells2(b,3).getValue();
var url = ‘<%=appPath%>/generateXMLTSPinsert.do?mode=update’;
if (window.XMLHttpRequest)
{
req = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
req = new ActiveXObject(‘Microsoft.XMLHTTP’);
}
req.open(‘POST’, url,false);
req.setRequestHeader(‘Content-Type’, ‘application/x-www-form-urlencoded’);
//req.onreadystatechange = callback;
req.send(‘tournum=’+document.forms[0].tourid.value+’&tourdate=’+ document.forms[0].tourdate.value+’&tourcode=’+ document.forms[0].tourcode.value+’&roomWith=’+roomWith+’&comments=’+comments);
mygrid2.updateFromXML(‘gridpal2.xml’);
}
}
I’m not sure why do you need to use
mygrid2.getSelectedCellIndex
var a = mygrid2.getSelectedId();
var b = mygrid2.getRowId(a);
The event handler already have necessary info
var roomWith= mygrid2.cells2(rowId,1).getValue();
var comments= mygrid2.cells2(rowId,3).getValue();
Also you code misses
return true;
at the end, without such line edit operation will be blocked.