Automatically selecting all text when editing item

Hi,

When an item is edited I want the existing text to be automatically selected in the textbox that appears. Currently the editing functionality shows the textbox but then the user has to use the mouse etc to select all text to delete or change it.

Just to give it a bit of a go I modified the dhtmlxtree_ed.js file to add an id to the input element that had the class=“intreeeditRow” which allowed me to easily find the textbox and then call .select() on it. I hooked this up to some specific JS code I had for adding a new node but I really want a solution that doesn’t require changing any of your code.

What is the best way to do this? Can it be done with either event handlers or existing methods etc that are already available?

Thanks.

Hi,

you may try to use the following:

tree.attachEvent("onEdit",function(stage){ if(stage==1) this._editCell.span.childNodes[0].select(); return true; })

Thanks, that is exactly what I was after.