Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tim on Sep 19, 2009 12:59
open dhtmlx forum
automatically selecting text in grid combo

For "ed" excells, I use the following code to automatically select the text when the user tabs to the cell:

grid.attachEvent("onEditCell",function(stage,id,ind){
if (stage == 1 && this.editor.obj)
this.editor.obj.select();

return true;
})

How can I achieve this with "combo" excell? A stand-alone dhtmlxCombo inside of a form does this by default, but not inside of grid.

Thanks!
-Tim
Answer posted by Alex (support) on Sep 21, 2009 08:33

In case of using combo excell you can try to use the following method:

...
grid.init()
var combo = mygrid.getColumnCombo(column_index);
grid.attachEvent("onEditCell",function(stage,id,index){
 if(stage==1 && index == column_index) combo.DOMelem_input.select() 
 return true
})