Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jul 07, 2008 12:00
open dhtmlx forum
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???
Answer posted by Support on Jul 08, 2008 01:49
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);
}}});