ObservableGridView
GroupingView
| Package: | CQ.Ext.grid |
| Class: | GroupingView |
| Extends: | CQ.Ext.grid.GridView |
| Clientlib: | cq.widgets |
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 | Defined By | |
|---|---|---|
|
autoFill : Boolean Defaults to false. Specify true to have the column widths re-proportioned when the grid is initially rendered. The in...
Defaults to false. Specify true to have the column widths re-proportioned when the grid is initially rendered. The initially configured width of each column will be adjusted to fit the grid width and prevent horizontal scrolling. If columns are later resized (manually or programmatically), the other columns in the grid will not be resized to fit the grid width. See forceFit also.
|
GridView | |
|
cancelEditOnToggle : Boolean True to cancel any editing when the group header is toggled. Defaults to true.
True to cancel any editing when the group header is toggled. Defaults to true.
|
GroupingView | |
|
cellSelector : String The selector used to find cells internally (defaults to 'td.x-grid3-cell')
The selector used to find cells internally (defaults to 'td.x-grid3-cell')
|
GridView | |
|
cellSelectorDepth : Number The number of levels to search for cells in event delegation (defaults to 4)
The number of levels to search for cells in event delegation (defaults to 4)
|
GridView | |
|
columnsText : String The text displayed in the 'Columns' menu item (defaults to 'Columns')
The text displayed in the 'Columns' menu item (defaults to 'Columns')
|
GridView | |
|
deferEmptyText : Boolean True to defer emptyText being applied until the store's first load (defaults to true).
True to defer emptyText being applied until the store's first load (defaults to true).
|
GridView | |
|
emptyGroupText : String The text to display when there is an empty group value (defaults to '(None)'). May also be specified per column, see ...
The text to display when there is an empty group value (defaults to '(None)'). May also be specified per column, see CQ.Ext.grid.Column.emptyGroupText.
|
GroupingView | |
|
emptyText : String Default text (html tags are accepted) to display in the grid body when no rows are available (defaults to ''). This v...
Default text (html tags are accepted) to display in the grid body when no rows are available (defaults to ''). This value will be used to update the mainBody:
|
GridView | |
|
enableGrouping : Boolean false to disable grouping functionality (defaults to true)
false to disable grouping functionality (defaults to true)
|
GroupingView | |
|
enableGroupingMenu : Boolean true to enable the grouping control in the column menu (defaults to true)
true to enable the grouping control in the column menu (defaults to true)
|
GroupingView | |
|
enableNoGroups : Boolean true to allow the user to turn off grouping (defaults to true)
true to allow the user to turn off grouping (defaults to true)
|
GroupingView | |
|
enableRowBody : Boolean True to add a second TR element per row that can be used to provide a row body that spans beneath the data row. Use t...
True to add a second TR element per row that can be used to provide a row body that spans beneath the data row. Use the getRowClass method's rowParams config to customize the row body.
|
GridView | |
|
forceFit : Boolean Defaults to false. Specify true to have the column widths re-proportioned at all times. The initially configured widt...
Defaults to false. Specify true to have the column widths re-proportioned at all times. The initially configured width of each column will be adjusted to fit the grid width and prevent horizontal scrolling. If columns are later resized (manually or programmatically), the other columns in the grid will be resized to fit the grid width. Columns which are configured with See autoFill. |
GridView | |
|
groupByText : String
Text displayed in the grid header menu for grouping by a column (defaults to 'Group By This Field').
|
GroupingView | |
|
groupMode : String Indicates how to construct the group identifier. 'value' constructs the id using raw value, 'display' constructs the ...
Indicates how to construct the group identifier. 'value' constructs the id using raw value, 'display' constructs the id using the rendered value. Defaults to 'value'.
|
GroupingView | |
|
groupRenderer : Function This property must be configured in the CQ.Ext.grid.Column for each column.
This property must be configured in the CQ.Ext.grid.Column for each column.
|
GroupingView | |
|
groupTextTpl : String The template used to render the group header (defaults to '{text}'). This is used to format an object which contains ...
The template used to render the group header (defaults to '{text}'). This is used to format an object which contains the following properties:
|
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 | |
|
headersDisabled : Boolean True to disable the grid column headers (defaults to false). Use the ColumnModel menuDisabled config to disable the m...
True to disable the grid column headers (defaults to false). Use the ColumnModel menuDisabled config to disable the menu for individual columns. While this config is true the following will be disabled:
|
GridView | |
|
hideGroupedColumn : Boolean true to hide the column that is currently grouped (defaults to false)
true to hide the column that is currently grouped (defaults to false)
|
GroupingView | |
|
ignoreAdd : Boolean true to skip refreshing the view when new rows are added (defaults to false)
true to skip refreshing the view when new rows are added (defaults to false)
|
GroupingView | |
|
markDirty : Boolean True to show the dirty cell indicator when a cell has been modified. Defaults to true.
True to show the dirty cell indicator when a cell has been modified. Defaults to true.
|
GridView | |
|
rowBodySelector : String The selector used to find row bodies internally (defaults to 'div.x-grid3-row')
The selector used to find row bodies internally (defaults to 'div.x-grid3-row')
|
GridView | |
|
rowBodySelectorDepth : Number The number of levels to search for row bodies in event delegation (defaults to 10)
The number of levels to search for row bodies in event delegation (defaults to 10)
|
GridView | |
|
rowOverCls : String
The CSS class added to each row when it is hovered over. Defaults to 'x-grid3-row-over'
|
GridView | |
|
rowSelector : String The selector used to find rows internally (defaults to 'div.x-grid3-row')
The selector used to find rows internally (defaults to 'div.x-grid3-row')
|
GridView | |
|
rowSelectorDepth : Number The number of levels to search for rows in event delegation (defaults to 10)
The number of levels to search for rows in event delegation (defaults to 10)
|
GridView | |
|
scrollOffset : Number The amount of space to reserve for the vertical scrollbar (defaults to undefined). If an explicit value isn't specifi...
The amount of space to reserve for the vertical scrollbar (defaults to undefined). If an explicit value isn't specified, this will be automatically calculated.
|
GridView | |
|
selectedRowClass : String The CSS class applied to a selected row (defaults to 'x-grid3-row-selected'). An example overriding the default styli...
The CSS class applied to a selected row (defaults to 'x-grid3-row-selected'). An example overriding the default styling:
Note that this only controls the row, and will not do anything for the text inside it. To style inner facets (like text) use something like: |
GridView | |
|
showGroupName : Boolean If true will display a prefix plus a ': ' before the group field value in the group header line. The prefix will cons...
If true will display a prefix plus a ': ' before the group field value in the group header line. The prefix will consist of the groupName (or the configured header if not provided) configured in the CQ.Ext.grid.Column for each set of grouped rows (defaults to true).
|
GroupingView | |
|
showGroupsText : String
Text displayed in the grid header for enabling/disabling grouping (defaults to 'Show in Groups').
|
GroupingView | |
|
sortAscText : String The text displayed in the 'Sort Ascending' menu item (defaults to 'Sort Ascending')
The text displayed in the 'Sort Ascending' menu item (defaults to 'Sort Ascending')
|
GridView | |
|
sortClasses : Array The CSS classes applied to a header when it is sorted. (defaults to ['sort-asc', 'sort-desc'])
The CSS classes applied to a header when it is sorted. (defaults to ['sort-asc', 'sort-desc'])
|
GridView | |
|
sortDescText : String The text displayed in the 'Sort Descending' menu item (defaults to 'Sort Descending')
The text displayed in the 'Sort Descending' menu item (defaults to 'Sort Descending')
|
GridView | |
|
startCollapsed : Boolean true to start all groups collapsed (defaults to false)
true to start all groups collapsed (defaults to false)
|
GroupingView | |
| 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 | |
|
dragZone : CQ.Ext.grid.GridDragZone
A customized implementation of a DragZone which provides default implementations
of the template methods of DragZone...
A customized implementation of a DragZone which provides default implementations of the template methods of DragZone to enable dragging of the selected rows of a GridPanel. See CQ.Ext.grid.GridDragZone for details. This will only be present:
|
GridView | |
|
headerTpl : CQ.Ext.Template
The template to use when rendering headers. Has a default template
|
GridView | |
|
mainBody : CQ.Ext.Element Read-only. The GridView's body Element which encapsulates all rows in the Grid.
This Element is only available after ...
Read-only. The GridView's body Element which encapsulates all rows in the Grid.
This Element is only available after the GridPanel has been rendered.
|
GridView | |
|
masterTpl : masterTpl
The master template to use when rendering the GridView. Has a default template
|
GridView | |
| Method | Defined By | |
|---|---|---|
GroupingView( Object config )
Parameters:
|
GroupingView | |
|
collapseAllGroups() : void Collapses all grouped rows.
Collapses all grouped rows.
Parameters:
|
GroupingView | |
enableBubble( String/Array events ) : void Enables events fired by this Observable to bubble up an owner hierarchy by calling
this.getBubbleTarget() if present....
Enables events fired by this Observable to bubble up an owner hierarchy by calling
This is commonly used by CQ.Ext.Components to bubble events to owner Containers. See CQ.Ext.Component.getBubbleTarget. The default implementation in CQ.Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly. Example:
Parameters:
|
Observable | |
|
expandAllGroups() : void Expands all grouped rows.
Expands all grouped rows.
Parameters:
|
GroupingView | |
findCellIndex( HTMLElement el ) : Number Return the index of the grid column which contains the passed HTMLElement. See also findRowIndexReturn the index of the grid column which contains the passed HTMLElement. See also findRowIndex
Parameters:
|
GridView | |
findRow( HTMLElement el ) : HTMLElement Return the HtmlElement representing the grid row which contains the passed element.
Return the HtmlElement representing the grid row which contains the passed element.
Parameters:
|
GridView | |
findRowBody( HTMLElement el ) : HTMLElement Return the HtmlElement representing the grid row body which contains the passed element.
Return the HtmlElement representing the grid row body which contains the passed element.
Parameters:
|
GridView | |
findRowIndex( HTMLElement el ) : Number Return the index of the grid row which contains the passed HTMLElement.
See also findCellIndex
Return the index of the grid row which contains the passed HTMLElement.
See also findCellIndex
Parameters:
|
GridView | |
focusCell( Number row, Number col ) : void Focuses the specified cell.
Focuses the specified cell.
Parameters:
|
GridView | |
focusRow( Number row ) : void Focuses the specified row.
Focuses the specified row.
Parameters:
|
GridView | |
getCell( Number row, Number col ) : HtmlElement Returns the grid's <td> HtmlElement at the specified coordinates.
Returns the grid's <td> HtmlElement at the specified coordinates.
Parameters:
|
GridView | |
|
getGridInnerWidth() : Number Returns the total internal width available to the grid, taking the scrollbar into account
Returns the total internal width available to the grid, taking the scrollbar into account
Parameters:
|
GridView | |
getGroupId( String value ) : String Dynamically tries to determine the groupId of a specific value
Dynamically tries to determine the groupId of a specific value
Parameters:
|
GroupingView | |
getHeaderCell( Number index ) : HtmlElement Return the <td> HtmlElement which represents the Grid's header cell for the specified column index.
Return the <td> HtmlElement which represents the Grid's header cell for the specified column index.
Parameters:
|
GridView | |
getRow( Number index ) : HtmlElement Return the <div> HtmlElement which represents a Grid row for the specified index.
Return the <div> HtmlElement which represents a Grid row for the specified index.
Parameters:
|
GridView | |
getRowClass( Record record, Number index, Object rowParams, Store store ) : String Override this function to apply custom CSS classes to rows during rendering. You can also supply custom
parameters t...
Override this function to apply custom CSS classes to rows during rendering. You can also supply custom
parameters to the row template for the current row to customize how it is rendered using the rowParams
parameter. This function should return the CSS class name (or empty string '' for none) that will be added
to the row's wrapping div. To apply multiple class names, simply return them space-delimited within the string
(e.g., 'my-class another-class'). Example usage:
Parameters:
|
GridView | |
handleHdMenuClickDefault( CQ.Ext.menu.BaseItem item ) : void Called by handleHdMenuClick if any button except a sort ASC/DESC button was clicked. The default implementation provi...
Called by handleHdMenuClick if any button except a sort ASC/DESC button was clicked. The default implementation provides
the column hide/show functionality based on the check state of the menu item. A different implementation can be provided
if needed.
Parameters:
|
GridView | |
refresh( [Boolean headersToo] ) : void Refreshs the grid UI
Refreshs the grid UI
Parameters:
|
GridView | |
relayEvents( Object o, Array events ) : void Relays selected events from the specified Observable as if the events were fired by this.
Relays selected events from the specified Observable as if the events were fired by this.
Parameters:
|
Observable | |
|
scrollToTop() : void Scrolls the grid to the top
Scrolls the grid to the top
Parameters:
|
GridView | |
toggleAllGroups( [Boolean expanded] ) : void Toggles all groups if no value is passed, otherwise sets the expanded state of all groups to the value passed.
Toggles all groups if no value is passed, otherwise sets the expanded state of all groups to the value passed.
Parameters:
|
GroupingView | |
toggleGroup( String groupId, [Boolean expanded] ) : void Toggles the specified group if no value is passed, otherwise sets the expanded state of the group to the value passed.
Toggles the specified group if no value is passed, otherwise sets the expanded state of the group to the value passed.
Parameters:
|
GroupingView | |
toggleRowIndex( Number rowIndex, [Boolean expanded] ) : void Toggle the group that contains the specific row.
Toggle the group that contains the specific row.
Parameters:
|
GroupingView | |
| Event | Defined By | |
|---|---|---|
beforerefresh : ( CQ.Ext.grid.GridView view ) Internal UI Event. Fired before the view is refreshed.
Internal UI Event. Fired before the view is refreshed.
Listeners will be called with the following arguments:
|
GridView | |
beforerowremoved : ( CQ.Ext.grid.GridView view, Number rowIndex, CQ.Ext.data.Record record ) Internal UI Event. Fired before a row is removed.
Internal UI Event. Fired before a row is removed.
Listeners will be called with the following arguments:
|
GridView | |
beforerowsinserted : ( CQ.Ext.grid.GridView view, Number firstRow, Number lastRow ) Internal UI Event. Fired before rows are inserted.
Internal UI Event. Fired before rows are inserted.
Listeners will be called with the following arguments:
|
GridView | |
refresh : ( CQ.Ext.grid.GridView view ) Internal UI Event. Fired after the GridView's body has been refreshed.
Internal UI Event. Fired after the GridView's body has been refreshed.
Listeners will be called with the following arguments:
|
GridView | |
rowremoved : ( CQ.Ext.grid.GridView view, Number rowIndex, CQ.Ext.data.Record record ) Internal UI Event. Fired after a row is removed.
Internal UI Event. Fired after a row is removed.
Listeners will be called with the following arguments:
|
GridView | |
rowsinserted : ( CQ.Ext.grid.GridView view, Number firstRow, Number lastRow ) Internal UI Event. Fired after rows are inserted.
Internal UI Event. Fired after rows are inserted.
Listeners will be called with the following arguments:
|
GridView | |
rowupdated : ( CQ.Ext.grid.GridView view, Number firstRow, CQ.Ext.data.record record ) Internal UI Event. Fired after a row has been updated.
Internal UI Event. Fired after a row has been updated.
Listeners will be called with the following arguments:
|
GridView | |