定时刷新 Store
Ext.define('Bit.eui.docs.template.view.Index', {
extend: 'Ext.panel.Panel',
xtype: 'docs-template-index',
viewModel: {},
layout: 'border',
cls: 'shadow-container',
interval: null,
items: [{
xtype: 'docs-category-tree',
region: 'west',
300,
split: {
collapsible: true
}
},
{
region: 'center',
margin: '0 0 0 8px',
cls: 'shadow-container',
layout: 'border',
split: {
collapsible: true
},
items: [{
xtype: 'docs-template-grid',
region: 'center',
flex: 2,
margin: '0 0 8px 0',
listeners: {
afterrender: function() {
var me = this;
me.interval = setInterval(function() {
me.getStore() && me.getStore().load();
}, 20000);
},
destroy: function() {
var me = this;
if (me.interval != null) {
clearInterval(me.interval);
interval = null;
}
}
},
}
]
}
]
});