我的网格中有一个自定义动作列,如下所示:
Ext.define('Profiler.view.Common.ActionColumn', {
alias: 'widget.asaActionColumn',
extend: 'Ext.grid.column.Action',
items: [{
iconCls: 'edit',
tooltip: __("Edit"),
handler: function (grid, rowIndex, colIndex) {
this.fireEvent('itemedit', grid, rowIndex, colIndex);
}
}, {
iconCls: 'delete',
tooltip: __("Delete"),
handler: function (grid, rowIndex, colIndex) {
this.fireEvent('itemdelete', grid, rowIndex, colIndex);
}
}, {
iconCls: 'information',
tooltip: __("Info"),
handler: function (grid, rowIndex, colIndex) {
this.fireEvent('PersonageInformation', grid, rowIndex, colIndex);
}
}]
});
但是当渲染页面不起作用时:
答案 0 :(得分:0)
oh.i得到它.i覆盖这样的构造函数:
Ext.define('Profiler.view.Common.ActionColumn', {
alias: 'widget.asaActionColumn',
extend: 'Ext.grid.column.Action',
constructor: function (config) {
this.initialConfig = config;
this.itemId = config.itemId = (config.itemId || config.id || Ext.id());
this.callParent(arguments);
this.items = [{
iconCls: 'Edit',
tooltip: __("Edit"),
handler: function (grid, rowIndex, colIndex) {
this.fireEvent('itemedit', grid, rowIndex, colIndex);
}
}, {
iconCls: 'delete',
tooltip: __("Delete"),
handler: function (grid, rowIndex, colIndex) {
this.fireEvent('itemdelete', grid, rowIndex, colIndex);
}
}, {
iconCls: 'information',
tooltip: __("Info"),
handler: function (grid, rowIndex, colIndex) {
this.fireEvent('PersonageInformation', grid, rowIndex, colIndex);
}
}];
},
});