X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/d41dc04ad17d1d9125fb2cf72db2b4782dbe3a8c..76cb34406ceaf9681a76e13b531d7eafa483ad88:/docs/output/Ext.grid.GroupingView.html diff --git a/docs/output/Ext.grid.GroupingView.html b/docs/output/Ext.grid.GroupingView.html index 96458219..5e4ba125 100644 --- a/docs/output/Ext.grid.GroupingView.html +++ b/docs/output/Ext.grid.GroupingView.html @@ -1,1093 +1,344 @@ -
Observable - GridView - GroupingView
Package: | Ext.grid |
Defined In: | GroupingView.js |
Class: | GroupingView |
Extends: | GridView |
var grid = new Ext.grid.GridPanel({
- // A groupingStore is required for a GroupingView
- store: new Ext.data.GroupingStore({
- reader: reader,
- data: xg.dummyData,
- sortInfo:{field: 'company', direction: "ASC"},
- groupField:'industry'
- }),
+Observable
GridView
GroupingView
Class Ext.grid.GroupingView
Package: Ext.grid Defined In: GroupingView.js Class: GroupingView Extends: GridView
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 Ext.grid.GridPanel({
+ // A groupingStore is required for a GroupingView
+ store: new Ext.data.GroupingStore({
+ autoDestroy: true,
+ reader: reader,
+ data: xg.dummyData,
+ sortInfo: {field: 'company', direction: 'ASC'},
+ groupOnSort: true,
+ remoteGroup: true,
+ groupField: 'industry'
+ }),
+ colModel: new Ext.grid.ColumnModel({
+ columns:[
+ {id:'company',header: 'Company', width: 60, dataIndex: 'company'},
+ // groupable, groupName, groupRender are also configurable at column level
+ {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price', groupable: false},
+ {header: 'Change', dataIndex: 'change', renderer: Ext.util.Format.usMoney},
+ {header: 'Industry', dataIndex: 'industry'},
+ {header: 'Last Updated', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
+ ],
+ defaults: {
+ sortable: true,
+ menuDisabled: false,
+ width: 20
+ }
+ }),
+
+ view: new 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 autoFill : BooleanDefaults to false. Specify true to have the column widths re-proportioned
+when the grid is initially rendered. The ...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 cellSelector : StringThe selector used to find cells internally (defaults to 'td.x-grid3-cell') GridView cellSelectorDepth : NumberThe number of levels to search for cells in event delegation (defaults to 4) GridView columnsText : StringThe text displayed in the "Columns" menu item (defaults to "Columns") GridView deferEmptyText : BooleanTrue to defer emptyText being applied until the store's
+first load (defaults to true). GridView emptyGroupText : StringThe 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 Ext.grid.Column.emptyGroupText. GroupingView emptyText : StringDefault 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:
+ this.mainBody.update('<div class="x-grid-empty">' + this.emptyText + '</div>');
GridView enableGrouping : Booleanfalse to disable grouping functionality (defaults to true) GroupingView enableGroupingMenu : Booleantrue to enable the grouping control in the column menu (defaults to true) GroupingView enableNoGroups : Booleantrue to allow the user to turn off grouping (defaults to true) GroupingView enableRowBody : BooleanTrue to add a second TR element per row that can be used to provide a row body
+that spans beneath the data row. Use ...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 : BooleanDefaults to false. Specify true to have the column widths re-proportioned
+at all times. The initially configured wi...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. See autoFill also. GridView groupByText : StringText displayed in the grid header menu for grouping by a column
+(defaults to 'Group By This Field'). GroupingView groupRenderer : FunctionThis property must be configured in the Ext.grid.Column for
+each column. GroupingView groupTextTpl : StringThe 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:
+
+- group : String
The rendered value of the group field.
+By default this is the unchanged value of the group field. If a groupRenderer
+is specified, it is the result of a call to that function.
+- gvalue : Object
The raw value of the group field.
+- text : String
The configured header (as described in showGroupName)
+if showGroupName is true) plus the rendered group field value.
+- groupId : String
A unique, generated ID which is applied to the
+View Element which contains the group.
+- startRow : Number
The row index of the Record which caused group change.
+- rs : Array
Contains a single element: The Record providing the data
+for the row which caused group change.
+- cls : String
The generated class name string to apply to the group header Element.
+- style : String
The inline style rules to apply to the group header Element.
+
+See Ext.XTemplate for information on how to format data using a template. Possible usage:var grid = new Ext.grid.GridPanel({
+ ...
+ view: new Ext.grid.GroupingView({
+ groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
+ }),
+});
GroupingView headersDisabled : BooleanTrue to disable the grid column headers (defaults to false).
+Use the ColumnModel menuDisabled
+config to disable the ...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:
+- clicking on header to sort
+- the trigger to reveal the menu.
+
GridView hideGroupedColumn : Booleantrue to hide the column that is currently grouped (defaults to false) GroupingView ignoreAdd : Booleantrue to skip refreshing the view when new rows are added (defaults to false) GroupingView listeners : ObjectA config object containing one or more event handlers to be added to this
+object during initialization. This should ...A config object containing one or more event handlers to be added to this
+object during initialization. This should be a valid listeners config object as specified in the
+addListener example for attaching multiple handlers at once.
+
DOM events from ExtJs Components
+
While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
+is usually only done when extra value can be added. For example the DataView's
+click
event passing the node clicked on. To access DOM
+events directly from a Component's HTMLElement, listeners must be added to the Element after the Component
+has been rendered. A plugin can simplify this step:
// Plugin is configured with a listeners config object.
+// The Component is appended to the argument list of all handler functions.
+Ext.DomObserver = Ext.extend(Object, {
+ constructor: function(config) {
+ this.listeners = config.listeners ? config.listeners : config;
+ },
+
+ // Component passes itself into plugin's init method
+ init: function(c) {
+ var p, l = this.listeners;
+ for (p in l) {
+ if (Ext.isFunction(l[p])) {
+ l[p] = this.createHandler(l[p], c);
+ } else {
+ l[p].fn = this.createHandler(l[p].fn, c);
+ }
+ }
+
+ // Add the listeners to the Element immediately following the render call
+ c.render = c.render.createSequence(function() {
+ var e = c.getEl();
+ if (e) {
+ e.on(l);
+ }
+ });
+ },
- columns: [
- {id:'company',header: "Company", width: 60, sortable: true, dataIndex: 'company'},
- {header: "Price", width: 20, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
- {header: "Change", width: 20, sortable: true, dataIndex: 'change', renderer: Ext.util.Format.usMoney},
- {header: "Industry", width: 20, sortable: true, dataIndex: 'industry'},
- {header: "Last Updated", width: 20, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
- ],
+ createHandler: function(fn, c) {
+ return function(e) {
+ fn.call(this, e, c);
+ };
+ }
+});
- view: new 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"]})'
- }),
+var combo = new Ext.form.ComboBox({
- 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
-
-
-
-
-
- autoFill : Boolean
- True to auto expand the columns to fit the grid when the grid is created.
-
- GridView
-
-
-
-
-
- cellSelector : String
- The selector used to find cells internally
-
- GridView
-
-
-
-
-
- cellSelectorDepth : Number
- The number of levels to search for cells in event delegation (defaults to 4)
-
- GridView
-
-
-
-
-
- deferEmptyText : Boolean
- True to defer emptyText being applied until the store's first load
-
- GridView
-
-
-
-
-
- emptyGroupText : String
- The text to display when there is an empty group value
-
- GroupingView
-
-
-
-
-
- emptyText : String
- Default text to display in the grid body when no rows are available (defaults to '').
-
- GridView
-
-
-
-
-
- enableGrouping : Boolean
- False to disable grouping functionality (defaults to true)
-
- GroupingView
-
-
-
-
-
- enableGroupingMenu : Boolean
- True to enable the grouping control in the column menu
-
- GroupingView
-
-
-
-
-
- enableNoGroups : Boolean
- True to allow the user to turn off grouping
-
- 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
- True to auto expand/contract the size of the columns to fit the grid width and prevent horizontal scrolling. This opt...
-
- True to auto expand/contract the size of the columns to fit the grid width and prevent horizontal scrolling. This option overrides any (@link Ext.grid.ColumnModel#width width} settings in the ColumnModel.
-
-
- GridView
-
-
-
-
-
- groupByText : String
- Text displayed in the grid header menu for grouping by a column (defaults to 'Group By This Field').
-
- GroupingView
-
-
-
-
-
- groupRenderer : Function
- The function used to format the grouping field value for display in the group header. Should return a string value. T...
-
- The function used to format the grouping field value for display in the group header. Should return a string value. This takes the following parameters: - v : Object
The new value of the group field.
- unused : undefined
Unused parameter.
- r : Ext.data.Record
The Record providing the data for the row which caused group change.
- rowIndex : Number
The row index of the Record which caused group change.
- colIndex : Number
The column index of the group field.
- ds : Ext.data.Store
The Store which is providing the data Model.
-
-
- GroupingView
-
-
-
-
-
- groupTextTpl : String
- The template used to render the group header. This is used to format an object which contains the following propertie...
-
- The template used to render the group header. This is used to format an object which contains the following properties: - group : String
The rendered value of the group field. By default this is the unchanged value of the group field. If a groupRenderer is specified, it is the result of a call to that.
- gvalue : Object
The raw value of the group field.
- text : String
The configured header (If showGroupName is true) plus the renderedgroup field value.
- groupId : String
A unique, generated ID which is applied to the View Element which contains the group.
- startRow : Number
The row index of the Record which caused group change.
- rs : Array
.Contains a single element: The Record providing the data for the row which caused group change.
- cls : String
The generated class name string to apply to the group header Element.
- style : String
The inline style rules to apply to the group header Element.
See Ext.XTemplate for information on how to format data using a template.
-
-
- GroupingView
-
-
-
-
-
- header : String
- The text with which to prefix the group field value in the group header line.
-
- GroupingView
-
-
-
-
-
- hideGroupedColumn : Boolean
- True to hide the column that is currently grouped
-
- GroupingView
-
-
-
-
-
- ignoreAdd : Boolean
- True to skip refreshing the view when new rows are added (defaults to false)
-
- GroupingView
-
-
-
-
-
- listeners : Object
- (optional) A config object containing one or more event handlers to be added to this object during initialization. Th...
-
- (optional) A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the addListener example for attaching multiple handlers at once.
-
-
- Observable
-
-
-
-
-
- rowSelector : String
- The selector used to find rows internally
-
- GridView
-
-
-
-
-
- rowSelectorDepth : Number
- The number of levels to search for rows in event delegation (defaults to 10)
-
- GridView
-
-
-
-
-
- showGroupName : Boolean
- True to display the name 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
-
-
-
-
-
- startCollapsed : Boolean
- True to start all groups collapsed
-
- GroupingView
-
-
-
- Public Properties
-
-
- Property
- Defined By
-
-
-
-
-
- columnsText : String
- The text displayed in the "Columns" menu item
-
- GridView
-
-
-
-
-
- dragZone : Ext.grid.GridDragZone
-This
-
-
- GridView
-
-
-
-
-
- mainBody : Ext.Element
- The GridView's body Element which encapsulates all rows in the Grid. Element. Read-only.
-This Element is only availab...
-
- The GridView's body Element which encapsulates all rows in the Grid. Element. Read-only.
-This Element is only available after the GridPanel has been rendered.
-
-
- GridView
-
-
-
-
-
- scrollOffset : Number
- The amount of space to reserve for the scrollbar (defaults to 19 pixels)
-
- GridView
-
-
-
-
-
- sortAscText : String
- The text displayed in the "Sort Ascending" menu item
-
- GridView
-
-
-
-
-
- sortClasses : Array
- 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
-
- GridView
-
-
-
- Public Methods
-
-
- Method
- Defined By
-
-
-
-
-
- GroupingView( Object config
)
-
-
-
- Parameters:
- config
: Object
- Returns:
-
-
-
-
-
-
-
- GroupingView
-
-
-
-
-
- addEvents( Object object
) : void
- Used to define events on this Observable
-
- Used to define events on this Observable
- Parameters:
- object
: ObjectThe object with the events defined
- Returns:
-
- void
-
-
-
-
-
- Observable
-
-
-
-
-
- addListener( String eventName
, Function handler
, [Object scope
], [Object options
] ) : void
- Appends an event handler to this component
-
- Appends an event handler to this component
- Parameters:
- eventName
: StringThe type of event to listen forhandler
: FunctionThe method the event invokesscope
: Object(optional) The scope in which to execute the handler
-function. The handler function's "this" context.options
: Object(optional) An object containing handler configuration
+ // Collapse combo when its element is clicked on
+ plugins: [ new Ext.DomObserver({
+ click: function(evt, comp) {
+ comp.collapse();
+ }
+ })],
+ store: myStore,
+ typeAhead: true,
+ mode: 'local',
+ triggerAction: 'all'
+});
Observable rowSelector : StringThe selector used to find rows internally (defaults to 'div.x-grid3-row') GridView rowSelectorDepth : NumberThe number of levels to search for rows in event delegation (defaults to 10) GridView scrollOffset : NumberThe amount of space to reserve for the vertical scrollbar
+(defaults to 19 pixels). GridView selectedRowClass : StringThe 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:
+ .x-grid3-row-selected {background-color: yellow;}
+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:
+ .x-grid3-row-selected .x-grid3-cell-inner {
+ color: #FFCC00;
+ }
GridView showGroupName : BooleanIf true will display a prefix plus a ': ' before the group field value
+in the group header line. The prefix will co...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
+Ext.grid.Column for each set of grouped rows (defaults to true). GroupingView showGroupsText : StringText displayed in the grid header for enabling/disabling grouping
+(defaults to 'Show in Groups'). GroupingView sortAscText : StringThe text displayed in the "Sort Ascending" menu item (defaults to "Sort Ascending") GridView sortClasses : ArrayThe CSS classes applied to a header when it is sorted. (defaults to ["sort-asc", "sort-desc"]) GridView sortDescText : StringThe text displayed in the "Sort Descending" menu item (defaults to "Sort Descending") GridView startCollapsed : Booleantrue to start all groups collapsed (defaults to false) GroupingView
Public Properties
Property Defined By dragZone : Ext.grid.GridDragZoneA 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 Ext.grid.GridDragZone for details.
+This will only be present:
+- if the owning GridPanel was configured with enableDragDrop: true.
+- after the owning GridPanel has been rendered.
+
GridView mainBody : Ext.ElementRead-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
Public Methods
Method Defined By GroupingView( Object config
)
+ Parameters:config
: Object
Returns:- void
GroupingView addEvents( Object object
)
+ :
+ voidUsed to define events on this ObservableUsed to define events on this ObservableParameters:object
: ObjectThe object with the events defined
Returns:- void
Observable addListener( String eventName
, Function handler
, [Object scope
], [Object options
] )
+ :
+ voidAppends an event handler to this object.Appends an event handler to this object.Parameters:eventName
: StringThe name of the event to listen for.handler
: FunctionThe method the event invokes.scope
: Object(optional) The scope (this
reference) in which the handler function is executed.
+If omitted, defaults to the object which fired the event.options
: Object(optional) An object containing handler configuration.
properties. This may contain any of the following properties:
-- scope : Object
The scope in which to execute the handler function. The handler function's "this" context.
-- delay : Number
The number of milliseconds to delay the invocation of the handler after the event fires.
-- single : Boolean
True to add a handler to handle just the next firing of the event, and then remove itself.
-- buffer : Number
Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed
+
- scope : ObjectThe scope (
this
reference) in which the handler function is executed.
+If omitted, defaults to the object which fired the event.
+- delay : NumberThe number of milliseconds to delay the invocation of the handler after the event fires.
+- single : BooleanTrue to add a handler to handle just the next firing of the event, and then remove itself.
+- buffer : NumberCauses the handler to be scheduled to run in an Ext.util.DelayedTask delayed
by the specified number of milliseconds. If the event fires again within that time, the original
-handler is not invoked, but the new handler is scheduled in its place.
+handler is not invoked, but the new handler is scheduled in its place.
+- target : ObservableOnly call the handler if the event was fired on the target Observable, not
+if the event was bubbled up from a child Observable.
Combining Options
Using the options argument, it is possible to combine different types of listeners:
-A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
-
el.on('click', this.onClick, this, {
+A delayed, one-time listener.
+myDataView.on('click', this.onClick, this, {
single: true,
- delay: 100,
- forumId: 4
+ delay: 100
});
Attaching multiple handlers in 1 call
The method also allows for a single argument to be passed which is a config object containing properties
which specify multiple handlers.
-
foo.on({
+myGridPanel.on({
'click' : {
- fn: this.onClick,
- scope: this,
+ fn: this.onClick,
+ scope: this,
delay: 100
},
'mouseover' : {
- fn: this.onMouseOver,
- scope: this
+ fn: this.onMouseOver,
+ scope: this
},
'mouseout' : {
- fn: this.onMouseOut,
- scope: this
+ fn: this.onMouseOut,
+ scope: this
}
});
Or a shorthand syntax:
-
foo.on({
- 'click' : this.onClick,
- 'mouseover' : this.onMouseOver,
- 'mouseout' : this.onMouseOut,
- scope: this
-});
- Returns:
-
- void
-
-
-
-
-
- Observable
-
-
-
-
-
- collapseAllGroups() : void
- Collapses all grouped rows.
-
- Collapses all grouped rows.
- Parameters:
- - None.
- Returns:
-
- void
-
-
-
-
-
- GroupingView
-
-
-
-
-
- expandAllGroups() : void
- Expands all grouped rows.
-
- Expands all grouped rows.
- Parameters:
- - None.
- Returns:
-
- void
-
-
-
-
-
- GroupingView
-
-
-
-
-
- findRow( Element el
) : The
- 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:
- el
: ElementThe target element
- Returns:
-
- The
row element, or null if the target element is not within a row of this GridView.
-
-
-
-
-
- GridView
-
-
-
-
-
- findRowIndex( Element el
) : The
- Return the index of the grid row which contains the passed element.
-
- Return the index of the grid row which contains the passed element.
- Parameters:
- el
: ElementThe target element
- Returns:
-
- The
row index, or false if the target element is not within a row of this GridView.
-
-
-
-
-
- GridView
-
-
-
-
-
- fireEvent( String eventName
, Object... args
) : Boolean
- Fires the specified event with the passed parameters (minus the event name).
-
- Fires the specified event with the passed parameters (minus the event name).
- Parameters:
- eventName
: Stringargs
: Object...Variable number of parameters are passed to handlers
- Returns:
-
- Boolean
returns false if any of the handlers return false otherwise it returns true
-
-
-
-
-
- Observable
-
-
-
-
-
- focusCell( Number row
, Number col
) : void
- Focuses the specified cell.
-
- Focuses the specified cell.
- Parameters:
- row
: NumberThe row indexcol
: NumberThe column index
- Returns:
-
- void
-
-
-
-
-
- GridView
-
-
-
-
-
- focusRow( Number row
) : void
- Focuses the specified row.
-
- Focuses the specified row.
- Parameters:
- row
: NumberThe row index
- Returns:
-
- void
-
-
-
-
-
- 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:
- row
: NumberThe row index in which to find the cell.col
: NumberThe column index of the cell.
- Returns:
-
- HtmlElement
The <TD> at the specified coordinates.
-
-
-
-
-
- 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:
- value
: String
- Returns:
-
- String
The group id
-
-
-
-
-
- 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:
- index
: NumberThe column index
- Returns:
-
- HtmlElement
The <TD> element.
-
-
-
-
-
- GridView
-
-
-
-
-
- getRow( Number index
) : HtmlElement
- Return the <TR> HtmlElement which represents a Grid row for the specified index.
-
- Return the <TR> HtmlElement which represents a Grid row for the specified index.
- Parameters:
- index
: NumberThe row index
- Returns:
-
- HtmlElement
The <TR> element.
-
-
-
-
-
- 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
+myGridPanel.on({
+ 'click' : this.onClick,
+ 'mouseover' : this.onMouseOver,
+ 'mouseout' : this.onMouseOut,
+ scope: this
+});
Returns:- void
Observable collapseAllGroups()
+ :
+ voidCollapses all grouped rows.Collapses all grouped rows.Parameters:- None.
Returns:- void
GroupingView enableBubble( Object events
)
+ :
+ voidUsed to enable bubbling of eventsUsed to enable bubbling of eventsParameters:events
: Object
Returns:- void
Observable expandAllGroups()
+ :
+ voidExpands all grouped rows.Expands all grouped rows.Parameters:- None.
Returns:- void
GroupingView findCellIndex( HTMLElement el
)
+ :
+ TheReturn 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 findRowIndexParameters:el
: HTMLElementThe target element
Returns:The
column index, or <b>false</b> if the target element is not within a row of this GridView.
GridView findRow( HTMLElement el
)
+ :
+ TheReturn the HtmlElement representing the grid row which contains the passed element.Return the HtmlElement representing the grid row which contains the passed element.Parameters:el
: HTMLElementThe target HTMLElement
Returns:The
row element, or null if the target element is not within a row of this GridView.
GridView findRowIndex( HTMLElement el
)
+ :
+ TheReturn the index of the grid row which contains the passed HTMLElement.
+See also findCellIndexReturn the index of the grid row which contains the passed HTMLElement.
+See also findCellIndexParameters:el
: HTMLElementThe target HTMLElement
Returns:The
row index, or <b>false</b> if the target element is not within a row of this GridView.
GridView fireEvent( String eventName
, Object... args
)
+ :
+ BooleanFires the specified event with the passed parameters (minus the event name).
+An event may be set to bubble up an Obse...Fires the specified event with the passed parameters (minus the event name).
+An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget)
+by calling enableBubble.
Parameters:eventName
: StringThe name of the event to fire.args
: Object...Variable number of parameters are passed to handlers.
Returns:Boolean
returns false if any of the handlers return false otherwise it returns true.
Observable focusCell( Number row
, Number col
)
+ :
+ voidFocuses the specified cell.Focuses the specified cell.Parameters:row
: NumberThe row indexcol
: NumberThe column index
Returns:- void
GridView focusRow( Number row
)
+ :
+ voidFocuses the specified row.Focuses the specified row.Parameters:row
: NumberThe row index
Returns:- void
GridView getCell( Number row
, Number col
)
+ :
+ HtmlElementReturns the grid's <td> HtmlElement at the specified coordinates.Returns the grid's <td> HtmlElement at the specified coordinates.Parameters:row
: NumberThe row index in which to find the cell.col
: NumberThe column index of the cell.
Returns:HtmlElement
The td at the specified coordinates.
GridView getGroupId( String value
)
+ :
+ StringDynamically tries to determine the groupId of a specific valueDynamically tries to determine the groupId of a specific valueParameters:value
: String
Returns:String
The group id
GroupingView getHeaderCell( Number index
)
+ :
+ HtmlElementReturn 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:index
: NumberThe column index
Returns:HtmlElement
The td element.
GridView getRow( Number index
)
+ :
+ HtmlElementReturn 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:index
: NumberThe row index
Returns:HtmlElement
The div element.
GridView getRowClass( Record record
, Number index
, Object rowParams
, Store store
)
+ :
+ StringOverride 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').
- Parameters:
- record
: RecordThe Ext.data.Record corresponding to the current rowindex
: NumberThe row indexrowParams
: ObjectA config object that is passed to the row template during rendering that allows
-customization of various aspects of a body row, if applicable. Note that this object will only be applied if
-enableRowBody = true, otherwise it will be ignored. The object may contain any of these properties:
-body
: String An HTML fragment to be rendered as the cell's body content (defaults to '').
-bodyStyle
: String A CSS style string that will be applied to the row's TR style attribute (defaults to '').
-cols
: Number The column count to apply to the body row's TD colspan attribute (defaults to the current
-column count of the grid).
-
store
: StoreThe Ext.data.Store this grid is bound to
- Returns:
-
- String
a CSS class name to add to the row.
-
-
-
-
-
- GridView
-
-
-
-
-
- hasListener( String eventName
) : Boolean
- Checks to see if this object has any listeners for a specified event
-
- Checks to see if this object has any listeners for a specified event
- Parameters:
- eventName
: StringThe name of the event to check for
- Returns:
-
- Boolean
True if the event is being listened for, else false
-
-
-
-
-
- Observable
-
-
-
-
-
- on( String eventName
, Function handler
, [Object scope
], [Object options
] ) : void
- Appends an event handler to this element (shorthand for addListener)
-
- Appends an event handler to this element (shorthand for addListener)
- Parameters:
- eventName
: StringThe type of event to listen forhandler
: FunctionThe method the event invokesscope
: Object(optional) The scope in which to execute the handler
-function. The handler function's "this" context.options
: Object(optional)
- Returns:
-
- void
-
-
-
-
-
- Observable
-
-
-
-
-
- purgeListeners() : void
- Removes all listeners for this object
-
- Removes all listeners for this object
- Parameters:
- - None.
- Returns:
-
- void
-
-
-
-
-
- Observable
-
-
-
-
-
- refresh( [Boolean headersToo
] ) : void
- Refreshs the grid UI
-
- Refreshs the grid UI
- Parameters:
- headersToo
: Boolean(optional) True to also refresh the headers
- Returns:
-
- void
-
-
-
-
-
- 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:
- o
: ObjectThe Observable whose events this object is to relay.events
: ArrayArray of event names to relay.
- Returns:
-
- void
-
-
-
-
-
- Observable
-
-
-
-
-
- removeListener( String eventName
, Function handler
, [Object scope
] ) : void
- Removes a listener
-
- Removes a listener
- Parameters:
- eventName
: StringThe type of event to listen forhandler
: FunctionThe handler to removescope
: Object(optional) The scope (this object) for the handler
- Returns:
-
- void
-
-
-
-
-
- Observable
-
-
-
-
-
- resumeEvents() : void
- Resume firing events. (see suspendEvents)
-
- Resume firing events. (see suspendEvents)
- Parameters:
- - None.
- Returns:
-
- void
-
-
-
-
-
- Observable
-
-
-
-
-
- scrollToTop() : void
- Scrolls the grid to the top
-
- Scrolls the grid to the top
- Parameters:
- - None.
- Returns:
-
- void
-
-
-
-
-
- GridView
-
-
-
-
-
- suspendEvents() : void
- Suspend the firing of all events. (see resumeEvents)
-
- Suspend the firing of all events. (see resumeEvents)
- Parameters:
- - None.
- Returns:
-
- void
-
-
-
-
-
- Observable
-
-
-
-
-
- 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:
- expanded
: Boolean(optional)
- Returns:
-
- void
-
-
-
-
-
- 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:
- groupId
: StringThe groupId assigned to the group (see getGroupId)expanded
: Boolean(optional)
- Returns:
-
- void
-
-
-
-
-
- GroupingView
-
-
-
-
-
- un( String eventName
, Function handler
, [Object scope
] ) : void
- Removes a listener (shorthand for removeListener)
-
- Removes a listener (shorthand for removeListener)
- Parameters:
- eventName
: StringThe type of event to listen forhandler
: FunctionThe handler to removescope
: Object(optional) The scope (this object) for the handler
- Returns:
-
- void
-
-
-
-
-
- Observable
-
-
-
- Public Events
-
-
- Event
- Defined By
-
-
-
-
-
- beforerefresh : ( 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:
- view
: Ext.grid.GridView
-
-
-
-
- GridView
-
-
-
-
-
- beforerowremoved : ( Ext.grid.GridView view
, Number rowIndex
, 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:
- view
: Ext.grid.GridViewrowIndex
: NumberThe index of the row to be removed.record
: Ext.data.RecordThe Record to be removed
-
-
-
-
- GridView
-
-
-
-
-
- beforerowsinserted : ( 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:
- view
: Ext.grid.GridViewfirstRow
: NumberThe index of the first row to be inserted.lastRow
: NumberThe index of the last row to be inserted.
-
-
-
-
- GridView
-
-
-
-
-
- refresh : ( 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:
- view
: Ext.grid.GridView
-
-
-
-
- GridView
-
-
-
-
-
- rowremoved : ( Ext.grid.GridView view
, Number rowIndex
, 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:
- view
: Ext.grid.GridViewrowIndex
: NumberThe index of the row that was removed.record
: Ext.data.RecordThe Record that was removed
-
-
-
-
- GridView
-
-
-
-
-
- rowsinserted : ( 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:
- view
: Ext.grid.GridViewfirstRow
: NumberThe index of the first inserted.lastRow
: NumberThe index of the last row inserted.
-
-
-
-
- GridView
-
-
-
-
-
- rowupdated : ( Ext.grid.GridView view
, Number firstRow
, 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:
- view
: Ext.grid.GridViewfirstRow
: NumberThe index of the row updated.record
: Ext.data.recordThe Record backing the row updated.
-
-
-
-
- GridView
-
-
-
-
\ No newline at end of file
+(e.g., 'my-class another-class'). Example usage:
+ viewConfig: {
+ forceFit: true,
+ showPreview: true, // custom property
+ enableRowBody: true, // required to create a second, full-width row to show expanded Record data
+ getRowClass: function(record, rowIndex, rp, ds){ // rp = rowParams
+ if(this.showPreview){
+ rp.body = '<p>'+record.data.excerpt+'</p>';
+ return 'x-grid3-row-expanded';
+ }
+ return 'x-grid3-row-collapsed';
+ }
+},
Parameters:record
: RecordThe Ext.data.Record corresponding to the current row.index
: NumberThe row index.rowParams
: ObjectA config object that is passed to the row template during rendering that allows
+customization of various aspects of a grid row.
+If enableRowBody is configured true, then the following properties may be set
+by this function, and will be used to render a full-width expansion row below each grid row:
+
+body
: String An HTML fragment to be used as the expansion row's body content (defaults to '').
+bodyStyle
: String A CSS style specification that will be applied to the expansion row's <tr> element. (defaults to '').
+
+The following property will be passed in, and may be appended to:
+
+tstyle
: String A CSS style specification that willl be applied to the <table> element which encapsulates
+both the standard grid row, and any expansion row.
+
store
: StoreThe Ext.data.Store this grid is bound to
Returns:String
a CSS class name to add to the row.
GridView hasListener( String eventName
)
+ :
+ BooleanChecks to see if this object has any listeners for a specified eventChecks to see if this object has any listeners for a specified eventParameters:eventName
: StringThe name of the event to check for
Returns:Boolean
True if the event is being listened for, else false
Observable on( String eventName
, Function handler
, [Object scope
], [Object options
] )
+ :
+ voidAppends an event handler to this object (shorthand for addListener.)Appends an event handler to this object (shorthand for addListener.)Parameters:eventName
: StringThe type of event to listen forhandler
: FunctionThe method the event invokesscope
: Object(optional) The scope (this
reference) in which the handler function is executed.
+If omitted, defaults to the object which fired the event.options
: Object(optional) An object containing handler configuration.
Returns:- void
Observable purgeListeners()
+ :
+ voidRemoves all listeners for this objectRemoves all listeners for this objectParameters:- None.
Returns:- void
Observable refresh( [Boolean headersToo
] )
+ :
+ voidRefreshs the grid UIRefreshs the grid UIParameters:headersToo
: Boolean(optional) True to also refresh the headers
Returns:- void
GridView relayEvents( Object o
, Array events
)
+ :
+ voidRelays 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:o
: ObjectThe Observable whose events this object is to relay.events
: ArrayArray of event names to relay.
Returns:- void
Observable removeListener( String eventName
, Function handler
, [Object scope
] )
+ :
+ voidRemoves an event handler.Removes an event handler.Parameters:eventName
: StringThe type of event the handler was associated with.handler
: FunctionThe handler to remove. This must be a reference to the function passed into the addListener call.scope
: Object(optional) The scope originally specified for the handler.
Returns:- void
Observable resumeEvents()
+ :
+ voidResume firing events. (see suspendEvents)
+If events were suspended using the queueSuspended parameter, then all
+event...Resume firing events. (see suspendEvents)
+If events were suspended using the queueSuspended parameter, then all
+events fired during event suspension will be sent to any listeners now.Parameters:- None.
Returns:- void
Observable scrollToTop()
+ :
+ voidScrolls the grid to the topScrolls the grid to the topParameters:- None.
Returns:- void
GridView suspendEvents( Boolean queueSuspended
)
+ :
+ voidSuspend the firing of all events. (see resumeEvents)Suspend the firing of all events. (see resumeEvents)Parameters:queueSuspended
: BooleanPass as true to queue up suspended events to be fired
+after the resumeEvents call instead of discarding all suspended events;
Returns:- void
Observable toggleAllGroups( [Boolean expanded
] )
+ :
+ voidToggles 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:expanded
: Boolean(optional)
Returns:- void
GroupingView toggleGroup( String groupId
, [Boolean expanded
] )
+ :
+ voidToggles 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:groupId
: StringThe groupId assigned to the group (see getGroupId)expanded
: Boolean(optional)
Returns:- void
GroupingView un( String eventName
, Function handler
, [Object scope
] )
+ :
+ voidRemoves an event handler (shorthand for removeListener.)Removes an event handler (shorthand for removeListener.)Parameters:eventName
: StringThe type of event the handler was associated with.handler
: FunctionThe handler to remove. This must be a reference to the function passed into the addListener call.scope
: Object(optional) The scope originally specified for the handler.
Returns:- void
Observable
Public Events
Event Defined By beforerefresh :
+ ( 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:view
: Ext.grid.GridView
GridView beforerowremoved :
+ ( Ext.grid.GridView view
, Number rowIndex
, 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:view
: Ext.grid.GridViewrowIndex
: NumberThe index of the row to be removed.record
: Ext.data.RecordThe Record to be removed
GridView beforerowsinserted :
+ ( 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:view
: Ext.grid.GridViewfirstRow
: NumberThe index of the first row to be inserted.lastRow
: NumberThe index of the last row to be inserted.
GridView refresh :
+ ( 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:view
: Ext.grid.GridView
GridView rowremoved :
+ ( Ext.grid.GridView view
, Number rowIndex
, 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:view
: Ext.grid.GridViewrowIndex
: NumberThe index of the row that was removed.record
: Ext.data.RecordThe Record that was removed
GridView rowsinserted :
+ ( 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:view
: Ext.grid.GridViewfirstRow
: NumberThe index of the first inserted.lastRow
: NumberThe index of the last row inserted.
GridView rowupdated :
+ ( Ext.grid.GridView view
, Number firstRow
, 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:view
: Ext.grid.GridViewfirstRow
: NumberThe index of the row updated.record
: Ext.data.recordThe Record backing the row updated.
GridView
\ No newline at end of file