Properties Methods Events Config Options Direct Link
Observable
  GridView
    GroupingView

Class CQ.Ext.grid.GroupingView

Package:CQ.Ext.grid
Class:GroupingView
Extends:CQ.Ext.grid.GridView
Clientlib:cq.widgets
Adds the ability for single level grouping to the grid. A GroupingStore must be used to enable grouping. Some grouping characteristics may also be configured at the Column level

Sample usage:

var grid = new CQ.Ext.grid.GridPanel({
    // A groupingStore is required for a GroupingView
    store: new CQ.Ext.data.GroupingStore({
        autoDestroy: true,
        reader: reader,
        data: xg.dummyData,
        sortInfo: {field: 'company', direction: 'ASC'},
        groupOnSort: true,
        remoteGroup: true,
        groupField: 'industry'
    }),
    colModel: new CQ.Ext.grid.ColumnModel({
        columns:[
            {id:'company',header: 'Company', width: 60, dataIndex: 'company'},
            // groupable, groupName, groupRender are also configurable at column level
            {header: 'Price', renderer: CQ.Ext.util.Format.usMoney, dataIndex: 'price', groupable: false},
            {header: 'Change', dataIndex: 'change', renderer: CQ.Ext.util.Format.usMoney},
            {header: 'Industry', dataIndex: 'industry'},
            {header: 'Last Updated', renderer: CQ.Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
        ],
        defaults: {
            sortable: true,
            menuDisabled: false,
            width: 20
        }
    }),

    view: new CQ.Ext.grid.GroupingView({
        forceFit: true,
        // custom grouping text template to display the number of items per group
        groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
    }),

    frame:true,
    width: 700,
    height: 450,
    collapsible: true,
    animCollapse: false,
    title: 'Grouping Example',
    iconCls: 'icon-grid',
    renderTo: document.body
});

Config Options

Config Options Defined By
  groupByText : String
Text displayed in the grid header menu for grouping by a column (defaults to 'Group By This Field').
GroupingView
  headerMenuOpenCls : String
The CSS class to add to the header cell when its menu is visible. Defaults to 'x-grid3-hd-menu-open'
GridView
  rowOverCls : String
The CSS class added to each row when it is hovered over. Defaults to 'x-grid3-row-over'
GridView
  showGroupsText : String
Text displayed in the grid header for enabling/disabling grouping (defaults to 'Show in Groups').
GroupingView

Public Properties

Property Defined By
  bodyTpl : CQ.Ext.Template
The template to use when rendering the body. Has a default template
GridView
  cellTpl : CQ.Ext.Template
The template to use to render each cell. Has a default template
GridView
  headerTpl : CQ.Ext.Template
The template to use when rendering headers. Has a default template
GridView
  masterTpl : masterTpl
The master template to use when rendering the GridView. Has a default template
GridView

Public Methods

Method Defined By

Public Events

Event Defined By