Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by joy on Jun 22, 2009 05:34
open dhtmlx forum
Row Added in Grid


hi,
Adding new row in grid row is added but focus is set on previous row.

function addRow(currGrid,rowIndex,parentIdValue){
  var newId =
rowIndex+1;  
  grid.addRow(newId,"text1,text2",1);

setValue(parentId,xml_doc,newId,mygrid);

//BUtton is added to the Grid for add new Row
    setAddButton(rowIndex, mygrid.getColIndexById('markDelete')+1, mygrid, currGrid.gridName);

grid.selectRowById(newId);

    return;
 
  }


function setAddButton(rowIndex,addColIndex,mygrid,mygridName)
{
        mygrid.cells2(rowIndex,addColIndex).cell.innerHTML='<INPUT TYPE="BUTTON" CLASS="INPUT"  onClick="javascript:addRow('+mygridName+','+rowIndex+');" VALUE="Add" id="add"'+rowIndex+' />';
       
}
Answer posted by dhxSupport on Jun 22, 2009 06:00
Please check if in the command grid.selectRowById(newId newId is a really uniqui id of the row.