Properties Methods Events Config Options Direct Link
Column
  ActionColumn

Class CQ.Ext.grid.ActionColumn

Package:CQ.Ext.grid
Class:ActionColumn
Extends:CQ.Ext.grid.Column
Clientlib:cq.widgets

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 CQ.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 Options Defined By
  align : String
Optional. Set the CSS text-align property of the column. Defaults to undefined.
Column

Public Properties

Property Defined By

Public Methods

Method Defined By

Public Events

Event Defined By