I have an UltraWebGrid with two cells -- the first cell is for editing, the last cell is for display purposes only. When the user is finished updating the first cell, I want the user to press the tab key to create a new row, if adding a new row, or navigate to the next row, if updating an existing row and if the next row exists. Currently, the way it behaves now is that the user has to click the tab key twice, and this is obviously because of the second and last cell of the row. I tried to hook into the EditKeyDownHandler as follows:
function uwgDocketNumbers_EditKeyDownHandler(gridName, cellId, key){ //Get the cell being edited
var cell = igtbl_getCellById(cellId); //Get the row of the cell being edited
var row = cell.getRow(); //Key Codes Tab = 9
if (key == '9') { if (row.getNextRow() == null) { cell.endEdit(true); row = igtbl_addNew(gridName, 0);
if (row != null) { row.getCell(0).activate(); row.getCell(0).beginEdit(); } }
}
But this doesn't address the solution. If I'm adding a brand new row -- the first row in the grid -- and I hit the tab key, a new row is inserted at the top and the row that I just added is added immediately after the first row. Can anyone point me in the right direction?
Thanks,Craig