PDA

View Full Version : Data not getting displayed in a TreePanel, after it is dynamically set in card layout



shwetapro
5 Aug 2012, 9:54 PM
Hi,

If I declare a tree panel in a file say PlanController and pass a dynamically generated store to the panel and then add it to the viewport(card layout), the data gets displayed very well, as shown below:

var store = ref.refreshPlanTreeData();

var panel = Ext.create('PanelJS', {
.
.
store: store,
columns:.....
});

globalViewPort.getLayout().setActiveItem(panel);

But if I create a template of the panel in other file(to maintain modularity and readability) and then I set the store into it, data doesnot gets displayed. Though the store gets set properly with all the data present in it.
Code goes below:

var store = ref.refreshPlanTreeData();

var panel = Ext.create('PanelJS');

Ext.apply(panel.getStore(), store); OR Ext.apply(panel, {
store: store
});

globalViewPort.getLayout().setActiveItem(panel);


Please tell me where am I going wrong?

Help appreciated.

Thanks,
Shweta