PDA

View Full Version : How to implement add a tab after the data loading is completely finish.



evilight
26 Dec 2011, 12:57 AM
just like this page
(http://dev.sencha.com/deploy/ext-4.0.7-gpl/docs/index.html#!/api)http://dev.sencha.com/deploy/ext-4.0.7-gpl/docs/index.html#!/api

when you click one component , for example, "grid"
it don't show the grid tab first, but load mask rolling.
right after all data is loaded, tab show.

I'm trying to show a data grid in a tab, before the data is fully loaded, I hope I can see the loading pitcure just like the api document dose.

So, first, I create a store, then create a grid panel, then add it to the tab panel.
but even I set loadMask to true in the grid panel, I still can not see the loading picture.
it will show an empty tab, and after 2-3 sec, all data show in the grid, without a loading picture.

I thought maybe it's because when I invoke result_tab_panel.add, the grid is not instantiation yet..

the part of code I use to add the grid panel into a tab is following:


var store = Ext.create('KWI.store.queueStatus',{id:'store'+index,});
store.load({ params: { mylimit: value} });
var grid = Ext.create('KWI.ui.gridpanel',{title: 'Result' + index , store: store});
result_tab_panel.add(grid);
result_tab_panel.setActiveTab(grid);
index++;

mitchellsimoens
26 Dec 2011, 8:05 AM
In 4.0.7 or before, you had to have the grid created and rendered before the store is loading. In 4.1.0, I fixed this issue.

evilight
26 Dec 2011, 6:34 PM
Thank you very much, I'll upgrade to 4.1.0 beta1 :)