PDA

View Full Version : image problem



newusername
5 Mar 2015, 1:32 AM
HI ,

How can I set focus on xtype = "image" ? Please help me out.

sviki89
5 Mar 2015, 3:21 AM
Use the method like this.
use it in 'afterrender' event under listeners.

image.focus();

newusername
5 Mar 2015, 5:15 AM
Well , I already tried it and it is not working.

skirtle
5 Mar 2015, 8:22 PM
From a quick look at the source code for focus it appears you need a suitable getFocusEl:

j84

SurenderBhyan1
8 Mar 2015, 10:30 PM
Skirtle,

?Working great for version 5.0.0 but seems not working in version 5.0.1.

skirtle
9 Mar 2015, 4:39 AM
This question is in the ExtJS 4 forum so I answered for that version.

For ExtJS 5 you need to set focusable: true and tabIndex to either 0 or -1, as appropriate. Depending on the exact version you may also need to override getFocusEl, though it is private.

Again, everything you need can be found from a quick look through the relevant parts of the source code.

SurenderBhyan1
10 Mar 2015, 1:39 AM
focusable: true and tabIndex: 0 worked for me.

Thank you Skirtle =D>

Please don't mind , I am a newbie here.