user1661892
user1661892

Reputation: 103

actioncolumn xtype column header is showing Actions in column hide/show list

In EXT JS grid, for column with xtype: actioncolumn, the column header is not showing up in show/hide column list. It comes up as 'Actions' by default for actioncolumn column. Can we override actual column header in the list of columns to show/hide for actioncolumn columns? Image shows a screenshow of examples from sencha examples.

enter image description here

Upvotes: 3

Views: 1330

Answers (1)

JChap
JChap

Reputation: 1441

If you want change the Label in Columns, You need to use a config called menuText for actioncolumn

Example: (https://fiddle.sencha.com/#fiddle/1944)

        {
            xtype:'actioncolumn',
            width:50,
            menuText: 'My Actions',
            items: [{
                icon: 'extjs-build/examples/shared/icons/fam/cog_edit.png',  // Use a URL in the icon config
                tooltip: 'Edit',
                handler: function(grid, rowIndex, colIndex) {
                    var rec = grid.getStore().getAt(rowIndex);
                    alert("Edit " + rec.get('firstname'));
                }
            },{
                icon: 'extjs-build/examples/restful/images/delete.png',
                tooltip: 'Delete',
                handler: function(grid, rowIndex, colIndex) {
                    var rec = grid.getStore().getAt(rowIndex);
                    alert("Terminate " + rec.get('firstname'));
                }
            }]
        }

Upvotes: 4

Related Questions