Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Anton on Mar 23, 2009 06:36
open dhtmlx forum
focus() doesn't work

Next command this.editor.edWin.focus(); doesn't work in IE7 and Opera, but it fine works in FF, Google Chrome and Safari.
Can you help me?
Answer posted by Alex (support) on Mar 23, 2009 08:12

You can try to use the following approach to set focus:

window.setTimeout(function(){

editor.edWin.focus();

editor.edDoc.body.focus();

},1);


Answer posted by Anton on Mar 23, 2009 08:25
It doesn't work. Because editor is undefined
Answer posted by Anton on Mar 23, 2009 08:30
editorEdWin = this.editor;
            window.setTimeout(function()
            {
                editorEdWin.edWin.focus();
                editorEdWin.edDoc.body.focus();
            },1);           
This works fine