0
votes

I have a form wih many fields in it and a close button at the end. Only in IE, when I tab out of the button, instead of going to the first field in the form, it tabs to the browser url and then to the tabs open in browser and home icon and all browser icons on the top. So, what I want to do is to catch the tab event on close button and bring the focus back to the first field in the form. So, I tried using specialkey, keyup and keydown in the listeners for the button. But, none of them were called when tab event was fired on button. I have enablekeyevents:true in the configuration. Can someone suggest me a way of capturing the tabout event on button. Thank you so much.

1
Perhaps catch the event that fires when the button loses focus? It is called blur. docs.sencha.com/extjs/4.2.1/#!/api/Ext.button.Button-event-blurforgivenson
Hey, Thanks so much for your quick response. I tried getting the focus back on the first field when button loses focus. It works but when I tab only in one direction. When I tab in the opposite direction, it again goes to the first field when it has to go the last field. Any idea on how can I fix this issue?user2316489
I suppose you'd have to detect whether the user did a TAB or SHIFT+TAB, and send it to the first or last field, appropriately. I'm not sure if that is possible with the blur event. However, I feel like there should be a better solution, a way to configure the tab order correctly. I'm not sure how though, and the fact that this is only in IE makes me shudder to think of what ugly hacks might be required. Sorry I can't be of more help.forgivenson

1 Answers

0
votes

I solved it by using blur event on button. I check on blur whether Ext.EventObject.Tab and Ext.EventObject.shiftKey exists