Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Abdul Bari on May 26, 2009 02:42
open dhtmlx forum
Grid Cell Does not lose focus

I have written code on edit cell event of Grid. The cursor still remains in Grid Cell. Could you please assist me that how to lose focus from the cell.



function doOnCellEdit(stage,rowId,cellInd)

{

if (cellInd==3)

{

if(stage==0)

{

//document.getElementById('btnSave').focus();

pos=mygrid.getPosition(mygrid.cellById(rowId,cellInd).cell)

r=rowId;c=cellInd;

showDiv('dvProvince',event);

document.form1.txtNameIns.focus();


}

}

}



Answer posted by dhxSupport on May 26, 2009 03:04
If you want to show some complex cell editor better to implement custom eXcell type. Please see more information here http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Custom_excell_creation.html#grid_cexc
Answer posted by Support on May 26, 2009 03:09
Stage 0 occurs before editor opening, you need to use stage 1 to move focus to some different input. 
By the way, if you need to just assign some custom reaction to single|double click - it better to use "ro" column type, and onRowSelect or onRowDblClicked event - both provides ID and index of clicked cell.
Answer posted by Abdul Bari on May 26, 2009 04:19

It works fine but now when i double click other cells they are also locked and i can not edit anything in them. I just want that this one column, when double clicked open popup and the rest of them should work editable as they are. Please assist me regarding it.

 

function doOnRowDblClicked(rowId,cellInd)

{

if (cellInd==3)

{

//document.getElementById('btnSave').focus();

pos=mygrid.getPosition(mygrid.cellById(rowId,cellInd).cell)

r=rowId;c=cellInd;

showDiv('dvProvince',event);

document.getElementById('ddlProvinceEdit').focus();

document.getElementById('ddlProvinceEdit').selectedIndex=-1;

}

else

{

hideDiv('dvProvince');

}

}

Answer posted by Abdul Bari on May 26, 2009 04:25

 

Its done, I just did returned true on other cells.