View Full Version : Prevent Grid goes toFront on view refresh

28 Feb 2013, 5:45 AM
Hi All,

Im developing on a "web desktop" environment, with windows with different components which show different data simultaneously and I have an issue with the grids, the grids have the "auto refresh" functionality and every time the grid refreshes the window with the grid goes to front, but I dont want it.

I want to know if there is any way to prevent the window goes to front when the grid refreshes.


2 Mar 2013, 11:10 AM
I don't see why it would bring it to front. There isn't anything in the code that when the grid store is loading it would bring it to front.

2 Apr 2013, 3:29 AM
The grid load mask is responsible of this behavior. When a grid bounded store is loaded a load mask is automatically showed up. The loadMask.js class has "afterShow" event defined which ends with a call to "onShowComplete" in Component.js, and finally a call to "Component.toFront" is performed.

This is the stack trace of the event:

Ext.define.updateActiveWindow (Desktop.js:422)
Ext.util.Event.Ext.extend.fire (ext-debug.js:16976)
Ext.define.continueFireEvent (Observable.js:291)
Ext.define.fireEvent (Observable.js:264)
Ext.override.fireEvent (EventBus.js:36)
Ext.define.setActive (Floating.js:272)
Ext.define._setActiveChild (ZIndexManager.js:109)
Ext.define._activateLast (ZIndexManager.js:134)
Ext.define.assignZIndices (ZIndexManager.js:100)
Ext.define.bringToFront (ZIndexManager.js:263)
Ext.define.toFront (Floating.js:232)
Ext.define.toFront (Floating.js:230)
Ext.define.onShowComplete (Component.js:861)
Ext.define.afterShow (Component.js:854)
Base.callParent (ext-debug.js:4800)
Ext.define.afterShow (LoadMask.js:240)
Ext.define.show (Component.js:796)
Ext.define.onBeforeLoad (LoadMask.js:205)
Ext.util.Event.Ext.extend.fire (ext-debug.js:16976)
Ext.define.continueFireEvent (Observable.js:291)
Ext.define.fireEvent (Observable.js:264)
Ext.define.load (AbstractStore.js:660)
Base.callParent (ext-debug.js:4800)
Ext.define.load (Store.js:999)

To avoid this behaviour you can disable the loadMask on grid viewConfig:

viewConfig: {
loadMask: false
and implement some custom "loading" feature for this kind of "background loaded grids".