Ext 简单定时任务
定时刷新 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', width: 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; } } }, } ] } ] });
作者:幸福摩天轮
------------------------------------------------
愿今日之努力日后想起还能浅浅一笑,不愿今日之颓废用长长一生去悔恨!
如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!