PDA

View Full Version : GridPanel Input Element Focus After RowSelectionModel Event: 'rowselect'



CaptainCrunch
25 Oct 2010, 2:18 PM
The title pretty much says it all... I seem to be having issues focusing on a text input element contained within a GridPanel cell after the RowSelectionModel 'rowselect' is fired. In a nutshell, I register a 'rowselect' event handler with the RowSelectionModel of my grid to simply focus on a text input when the row is selected. Unfortunately, it doesn't seem to focus on the element. My guess is that the GridPanel is registering its own event handler that steals the focus from my element after my function has finished execution.

As you might expect, I can use a setTimeout to delay the focus and it seems to work fine, but I'd rather avoid a dependency on browser execution time if possible. I thought about extending the RowSelectionModel to add a 'afterrowselect' event but I'm not so sure this would help if the registered event handlers are fired asynchronously...

I can post the code if necessary, but I'm not sure it would be of any benefit considering my event handler is triggered when expected and delaying the execution of the .focus() seems to "resolve" the issue.

Any Ideas?

Thanks in advance...