Search code examples
javascriptextjsextjs4modal-dialogfocus

ExtJS Prevent LoadMask from Stealing Focus


I have established my own Store class where I can optionally enable "Polling" on the store, which initializes a TaskRunner task to reload() the Store on a defined internal. That is all well and good, however when the PollingStore is bound to a View, the LoadMask will automatically show whenever the reload() method is invoked.

This is desirable behavior.... for the most part. My issue is that when the user has another window (e.g., for creating a new product) open "in front" of the grid (in zindex terms). Whenever the reload() method is invoked on the Store, the now-bound LoadMask will appear in front of EVERYTHING, i.e., including the window that the user is currently interacting with, which is separate from the Grid associated to the Store being loaded.

I have managed to override the initComponent method and ensure that the LoadMask does not appear "over" other components, but it still manages to steal focus from whatever form fields the user happens to be filling out in the modal window at that time....

Again, breakdown of steps here...

  1. Establish a Grid with a connected Store
  2. Establish TaskRunner task on Store to reload every 30 seconds
  3. While viewing the Grid, open a modal Window containing a few form fields
  4. Begin filling out form fields. Whenever the Store happens to reload, focus will be stolen. THIS IS THE PROBLEM

Any input would be great, please ask if any additional information or screenshots would be helpful.


Solution

  • I ended up patching to 4.2.1 which has solved my issue, LoadMasks are now properly bound to a view and do not take precedence over modal windows, and tooltips no longer steal focus.