dhtmlxGrid And Tab order


Is it possible to control tab order in the cells based on the value of a cell?

I found this piece of code in the knowledge base,



detailgrid.attachEvent(“onTab”,function(){

var ind = detailgrid.getRowIndex(detailgrid.getSelectedRowId());

var cind=detailgrid.getSelectedCellIndex();



if (cind==1) cind==3; //tab from 2 to 4

else if (cind==3) { cind=1; ind++; } //tab to cell 2 on next row



if (ind==this.getRowsNum()) return true; // last row in grid

detailgrid.selectCell(ind,cind);

detailgrid.editCell();

return false;

});



I used this code but not working?



If this can be used, where is this to be done?



I have a grid with 8 columns after the 4th cell, tab should move focus to the first cell on the next row.



help me please…



I used this code but not working?

onTab event exists only in latest version of dhtmlxgrid, if you are using older version - it will not work ( by the way, which version of the grid you are using? )

In older version of grid you can use onKeyPress event which occurs for any key action ( you can check the key code and execute necessary logic )

If you are using latest version of grid and logic still doens’t work for you - please contact us directly at support@dhtmlx.com - we will provide a working sample