Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Berkich on May 05, 2008 22:33
open dhtmlx forum
automatically selecting text in an edit box when a cell is selected

I need to have the text in a standard edit cell selected immediately when a user selects the cell. Essentially when the user goes into edit mode I want all of the text selected so that they can immediately start typing in a new value without having to delete the text first

Thanks
Dan
Answer posted by Support on May 07, 2008 01:57
You can

a) use excel-like keymap
    http://dhtmlx.com/docs/products/dhtmlxGrid/samples/navigation/pro_keymap_excel.html
    http://dhtmlx.com/docs/products/dhtmlxGrid/samples/navigation/pro_keymap_access.html

or

b) try to use next command
    grid.attachEvent("onEditCell",function(stage,id,ind){
       if (stage == 1 && this.editor.obj)
          this.editor.obj.select();
      
       return true;
    })
Answer posted by berkich on May 07, 2008 21:40

The URL pointing to the example for keymap works great but there is no information on how to activate the keymap http://dhtmlx.com/docs/products/dhtmlxGrid/samples/navigation/pro_keymap_excel.html
I appreciate your other information though

Thanks

Dan

Answer posted by Support on May 08, 2008 05:29
You just need to include "dhtmlxgrid_keymap_excel.js" extension on  the page