Tab changing

my grid has 5 columns. with in that only 3rd column is not editable. now i want to control the tab. when i press the tab control should directly goes to 2nd column to 4th column. here i am using the code like this but event is not firing.



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

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

alert("index is "+ind);

var cind=detailgrid.getSelectedCellIndex();

alert("cind is "+cind);

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

detailgrid.selectCell(ind,cind);

detailgrid.editCell();

return false;

});



at the same time i right the code on “onEditCell” event. it works fine. but tab change is not working properly.

when i press the tab control should directly goes to 2nd column to 4th column
If you mean that only two columns need to be active for tab actions

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;
});