PDA

View Full Version : html editor focus issue



sanketgandhi876
4 Jan 2015, 11:36 PM
Hello all,
I have following requirement:
While typing in html editor if any window get display then focus is get on that new window. I want to focus where I was writing message in html editor.
I tried this :
Ext.get(document.activeElement.id).focus(false, 100);
But not working.. :(

Any help please.

Thanks in advance

Gary Schlosberg
5 Jan 2015, 6:01 AM
What version of ExtJS are you using? Are you talking about other browser windows or windows from other programs?

sanketgandhi876
5 Jan 2015, 7:13 AM
Thanks for reply Gary :)
I'm using extjs v4.1.3, ubuntu (Firefox v33.0).

Here is more details:
In form I have used HtmlEditor (in background Cron is running which will show window after some time). So while writing in editor if window gets open then focus will be on new window. I have to focus cursor again on HtmlEditor.
For other field like textarea I resolved that problem by using

Ext.get(document.activeElement.id).focus(false, 100);
But in case of HtmlEditor document.activeElement returns name of iFrame which doesn't allow to focus.

I hope u got my point.

Gary Schlosberg
2 Feb 2016, 8:11 AM
I see now, thanks. Here's a thread which I hope will help.
https://www.sencha.com/forum/showthread.php?307817