0

I have a custom actioncolumn in my grid like this:

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

});

but when render page not working: enter image description here

1 Answers1

0

oh.i get it.i override constructor like this:

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

    },

});
  • This solution will work but there is no need to duplicate constructor logic. Just do the callParent and not `this.initialConfig = conf ..` . Sorry for the downvote but the misuse of the intialConfig property is a pet peeve of mine. – pllee Feb 06 '13 at 22:44