PDA

View Full Version : Mask a grid before shows it



silve69
27 Oct 2014, 10:47 AM
Hello friends,

I have a border layout with a "center" panel where I load dynamic content.
Currently I have a "Load Grid" in the toolbar and I would like to show a loadMask inmediatly the button is pressed... with the following code, the mask shows just after the grid is loaded, not before and I have 3-4 seconds with the panel "in white".


showUsersList: function(button, e, eOpts) {

var my_target = Ext.getCmp('content_panel');

my_target.removeAll();

var myMask = new Ext.LoadMask({ msg: 'Please wait...', target: my_target });

myMask.show();
my_target.add(Ext.widget('sf1usersgrid', { title: 'Full Users List' }));
}

Some idea how fix that?

Best regards,
Silver

scottmartin
27 Oct 2014, 3:33 PM
Why not just the grid right away with a loadmask set and then call grid.store.load() to show the mask while gathering the data?

silve69
27 Oct 2014, 4:04 PM
Thanks scottIn the "center" region I'm showing different components, depending of button pressed... maybe gridpanel, formpanel or chart... the removeAll clean the panel before load the new component... but, 3-4 seconds after pressed the button appear the grid with the mask.

scottmartin
28 Oct 2014, 5:44 AM
If you have different forms, I would then use a card layout that presents each component based on selection by selecting that page.

silve69
28 Oct 2014, 8:10 AM
Thanks a lot Scott, I will try with card layout, in the first view the login form and the next views the grids, forms and charts.