focus

mygrid.attachEvent(“onEditCell”,function(stage,id,ind,newValue,oldValue){

if (stage == 2){

if(ind ==0){

alert(‘ID should be greater than zero.’);

}}});



after i display the alert how can i put the focus back into the cell 0 of the edited row???

There is no way to block cell editor closing, so the only solution, reopen the cell with some timeout.

mygrid.attachEvent(“onEditCell”,function(stage,id,ind,newValue,oldValue){

    if (stage == 2){

        if(ind ==0){

            alert(‘ID should be greater than zero.’);

            window.setTimeout(function(){
                mygrid.selectCell(mygrid.getRowIndex(id),ind);
                mygrid.editCell();
            },1);
}}});