首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >扩展Ext.grid.column.Action

扩展Ext.grid.column.Action
EN

Stack Overflow用户
提问于 2013-02-06 18:21:42
回答 1查看 1.3K关注 0票数 0

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

代码语言:javascript
复制
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);
        }
    }]

});

但是当渲染页面不工作时:

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-06 18:32:12

哦。我明白了。我像这样重写构造函数:

代码语言:javascript
复制
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);
            }
        }];

    },

});
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14726595

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档