Column
  ActionColumn

Class Ext.grid.ActionColumn

Package:Ext.grid
Defined In:Column.js
Class:ActionColumn
Extends:Column

A Grid column type which renders an icon, or a series of icons in a grid cell, and offers a scoped click handler for each icon. Example usage:

new Ext.grid.GridPanel({
    store: myStore,
    columns: [
        {
            xtype: 'actioncolumn',
            width: 50,
            items: [
                {
                    icon   : 'sell.gif',                // Use a URL in the icon config
                    tooltip: 'Sell stock',
                    handler: function(grid, rowIndex, colIndex) {
                        var rec = store.getAt(rowIndex);
                        alert("Sell " + rec.get('company'));
                    }
                },
                {
                    getClass: function(v, meta, rec) {  // Or return a class from a function
                        if (rec.get('change') < 0) {
                            this.items[1].tooltip = 'Do not buy!';
                            return 'alert-col';
                        } else {
                            this.items[1].tooltip = 'Buy stock';
                            return 'buy-col';
                        }
                    },
                    handler: function(grid, rowIndex, colIndex) {
                        var rec = store.getAt(rowIndex);
                        alert("Buy " + rec.get('company'));
                    }
                }
            ]
        }
        //any other columns here
    ]
});

The action column can be at any index in the columns array, and a grid can have any number of action columns.

Config Options

Config OptionsDefined By
 align : String
Optional. Set the CSS text-align property of the column. Defaults to undefined.
Column
 altText : String
The alt text to use for the image element. Defaults to ''.
ActionColumn
 fixed : Boolean
Optional. true if the column width cannot be changed. Defaults to false.
Column
 icon : String
The URL of an image to display as the clickable element in the column. Optional - defaults to Ext.BLANK_IMAGE_URL.
ActionColumn
 menuDisabled : Boolean
Optional. true to disable the column menu. Defaults to false.
Column
 resizable : Boolean
Optional. false to disable column resizing. Defaults to true.
Column
 scope : Object
The scope (this reference) in which the handler and getClass fuctions are executed. Defaults to this Column.
ActionColumn
 stopSelection : Boolean
Defaults to true. Prevent grid row selection upon mousedown.
ActionColumn
 tooltip : String
A tooltip message to be displayed on hover. Ext.QuickTips must have been initialized.
ActionColumn

Public Properties

PropertyDefined By

Public Methods

MethodDefined By

Public Events

EventDefined By