当前位置: 动力学知识库 > 问答 > 编程问答 >

extjs4.1 - Grid on second tab doesnot load data on render

问题描述:

I have a form panel and i have added a tabpanel to it. Tab Panel has 2 tabs. When the form panel is loaded the first tab's grid loads fine but when i click on the second tab i do see the grids but data is not loaded by default. But it does refresh with data When i click on the grid header.

Below is the piece of code that i use to load the grids from controllers.

var store = this.getDeficiencyDeficiencyStoreStore();

store.on('load',function() {

var accountDeliverySettingsGrid = Ext.getCmp('accountDeliverySettingsGrid');

accountDeliverySettingsGrid.reconfigure(model.allQuartesListStore);

accountDeliverySettingsGrid.getView().refresh();

})

Any help/suggestions/advice is appreciated.

网友答案:

I finally figured this out. I had to use event: activate to explicitly invoke refresh method to get the grids loaded. Below is the piece of code.

  listeners: { activate: function(tab)
    { //alert("Put Your Logic Here"); 
    Ext.getCmp('accountDeliverySettingsGrid').getView().refresh(); 
    Ext.getCmp('compositeRelationship').getView().refresh(); 
}
分享给朋友:
您可能感兴趣的文章:
随机阅读: