公司的项目,原先是用ExtJs6.0写的,升级到6.2之后gridpanel滑动时就会卡顿,我用了bufferdstore的方法去写还是不行,主要部分代码如下
Ext.define('CallCenter.view.main.ContactsGrid', { extend: 'Ext.grid.Panel', xtype: 'xContactsGrid', frame: true, selType:'checkboxmodel', selModel: { checkOnly: true, mode:'SIMPLE', // pruneRemoved: false }, // plugins: [{ // ptype: 'bufferedrenderer' // }], loadMask: true, //加载数据时有遮罩效果 controller:'contactsGrid', cls:'widgtcol gridHeadBtn', overflowY:'auto', listeners:{ beforedestroy:'clearStore' }, initComponent: function(){ var pluginExpanded = true; var store = Ext.getStore('ContactsStore'); store.removeAll(); Ext.apply(this, { store: store, columns: [ { text: '联系人', dataIndex: 'name', flex: 1, align:'center', xtype: 'widgetcolumn', widget: { xtype: 'button', listeners: { click: 'modifyContacts' } } }, { text: '性别', dataIndex: 'sex', flex: 1, align:'center', renderer:this.renderSex }, { text: '固定电话(分机)', dataIndex: 'landingTele', flex: 1, align:'center', xtype: 'widgetcolumn', widget: { xtype: 'button', listeners: { click: 'callTel' } } }, { text: '手机号码', dataIndex: 'mobile', flex: 1, align:'center', xtype: 'widgetcolumn', widget: { xtype: 'button', listeners: { click: 'callMobile' } } }, { text: '其他号码', dataIndex: 'otherPhone', flex: 1, align:'center', xtype: 'widgetcolumn', widget: { xtype: 'button', listeners: { click: 'callOtherPhone' } } }, { text: '传真号', dataIndex: 'faxNo', flex: 1, align:'center' }, { text: '邮箱', dataIndex: 'email', flex: 1, align:'center' } ], dockedItems: [{ xtype: 'toolbar', dock: 'top', items: [ { xtype: 'button', text: '批量删除', icon:'resources/images/delete.png', style:{ marginLeft:'10px' }, listeners:{ click:'deleteClick' } },{ xtype: 'button', text: '新建联系人', icon:'resources/images/add.png', style:{ marginLeft:'10px' }, listeners:{ click:'addContacts' } },{ xtype: 'button', text: '导出联系人', icon:'resources/images/export.png', style:{ marginLeft:'10px' }, listeners:{ click:'downloadDemo' } },{ xtype: 'button', text: '导入联系人', icon:'resources/images/import.png', style:{ marginLeft:'10px' }, listeners:{ click:'showImportWin' } } ] }]/*, bbar: Ext.create('Ext.PagingToolbar', { store: store, displayInfo: true, displayMsg: '当前显示 {0} - {1} of {2}', emptyMsg: "当前无数据", plugins: new CallCenter.ux.PageSize() })*/ }); this.callParent(); }, renderSex:function(value){ if(value == 0){ return '男'; }else if(value == 1){ return '女'; } }});Ext.define('CallCenter.store.ContactsStore', { extend: 'CallCenter.store.BasicStore', // extend: 'Ext.data.BufferedStore', model: 'CallCenter.model.Contacts', autoLoad: false, // leadingBufferZone: 300, // pageSize: 50, pagesize: 5, proxy: { type:'ajax', url: 'others/contacts/xContactsWin/queryContacts', extraParams:{ }, actionMethods: { create: 'POST', read: 'POST', update: 'POST', destroy: 'POST' }, reader: { type:'json' ,rootProperty: 'listData' ,totalProperty: 'totalSize' }, enablePaging: true }, listeners : { load : function(store) { } }}); |