我需要锁定网格中的一些列。这是我的网格配置代码:
Ext.define('Crm.view.tables.baseTable', {
extend: 'Ext.grid.Panel',
alias : 'widget.baseTable',
columnLines: true,
initComponent: function(){
var that = this;
var $this = that;
this.selType = 'checkboxmodel',
this.selModel = {
allowDeselect: true,
mode: "MULTI"
};
this.plugins = [
new Ext.grid.plugin.CellEditing({
clicksToEdit: 2
}),
{
ptype: 'bufferedrenderer',
numFromEdge: 8,
trailingBufferZone: 10,
leadingBufferZone: 10
}
];
var filters = {
ftype: 'filters',
encode: true,
local: true
};
this.features = [filters];
var columns = [
new Ext.grid.RowNumberer(),
{
header : 'ID',
dataIndex: 'id',
locked : true,
filterable: true,
width : 30
},{
header : 'ФИО',
width : 100,
dataIndex: 'name',
filterable: true,
filter: {
type: 'string'
},
editor: 'textfield'
},{
header : 'Телефон',
dataIndex: 'phone',
filterable: true,
width : 75,
editor: 'textfield'
},{
header : 'Email',
dataIndex: 'email',
filterable: true,
width : 90,
editor: 'textfield'
}
];
this.columns = columns
var tbar = [{
text: 'Обновить',
handler: function(){
$this.getStore().reload();
}
},'-',{
text: 'Очистить фильтр',
handler: function () {
that.filters.clearFilters();
}
},'-']
this.tbar = tbar;
this.callParent();
}
});
但我收到一个错误:
Uncaught TypeError: Cannot call method 'on' of undefined ext-all-debug.js:115013
当我bufferedrenderer
从配置中删除插件时,锁定的列有效。问题是什么?感谢您的回答!