0

我的网格中有一个自定义操作列,如下所示:

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);
        }
    }]

});

但是当渲染页面不起作用时: 在此处输入图像描述

4

1 回答 1

0

哦。我明白了。我像这样覆盖构造函数:

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);
            }
        }];

    },

});
于 2013-02-06T10:32:11.723 回答