| Package: | Ext.grid |
| Defined In: | .js |
| Class: | |
| Extends: | Ext.grid.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'
}),
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'}
],
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
});
| 配置项 | 定义者 | |
|---|---|---|
| hideGroupedColumn : Boolean
True to hide the column that is cur...
True to hide the column that is currently grouped
|
GroupingView | |
| showGroupName : Boolean
True to display the name for each s...
True to display the name for each set of grouped rows (defaults to false)
|
GroupingView | |
| startCollapsed : Boolean
True to start all groups collapsed
True to start all groups collapsed
|
GroupingView | |
| enableGrouping : Boolean
False to disable grouping functiona...
False to disable grouping functionality (defaults to true)
|
GroupingView | |
| enableGroupingMenu : Boolean
True to enable the grouping control...
True to enable the grouping control in the column menu
|
GroupingView | |
| enableNoGroups : Boolean
True to allow the user to turn off ...
True to allow the user to turn off grouping
|
GroupingView | |
| emptyGroupText : String
The text to display when there is a...
The text to display when there is an empty group value
|
GroupingView | |
| ignoreAdd : Boolean
True to skip refreshing the view wh...
True to skip refreshing the view when new rows are added (defaults to false)
|
GroupingView | |
| groupTextTpl : String
The template used to render the gro...
The template used to render the group text
|
GroupingView | |
| groupByText : String
Text displayed in the grid header m...
Text displayed in the grid header menu for grouping by a column
(defaults to 'Group By This Field').
|
GroupingView | |
| showGroupsText : String
Text displayed in the grid header f...
Text displayed in the grid header for enabling/disabling grouping
(defaults to 'Show in Groups').
|
GroupingView | |
| autoFill : Boolean
True to auto expand the columns to ...
True to auto expand the columns to fit the grid when the grid is created.
|
GridView | |
| forceFit : Boolean
True to auto expand/contract the si...
True to auto expand/contract the size of the columns to fit the grid width and prevent horizontal scrolling.
|
GridView | |
| 属性 | 定义者 | |
|---|---|---|
|
scrollOffset: Number
预留给滚动条的空白位置(默认为19像素)
预留给滚动条的空白位置(默认为19像素)
|
GridView | |
|
sortClasses: Array
The CSS classes applied to a header...
The CSS classes applied to a header when it is sorted. (defaults to ["sort-asc", "sort-desc"])
|
GridView | |
|
sortAscText: String
The text displayed in the "Sort Asc...
The text displayed in the "Sort Ascending" menu item
|
GridView | |
|
sortDescText: String
The text displayed in the "Sort Des...
The text displayed in the "Sort Descending" menu item
|
GridView | |
|
columnsText: String
The text displayed in the "Columns"...
The text displayed in the "Columns" menu item
|
GridView | |
| 方法 | 定义者 | |
|---|---|---|
toggleGroup
(
String groupId,
Boolean expanded
)
Toggles the specified group if no v...
Toggles the specified group if no value is passed, otherwise sets the expanded state of the group to the value passed.
参数项:
|
GroupingView | |
toggleAllGroups
(
Boolean expanded
)
Toggles all groups if no value is p...
Toggles all groups if no value is passed, otherwise sets the expanded state of all groups to the value passed.
参数项:
|
GroupingView | |
|
expandAllGroups
(
)
Expands all grouped rows.
Expands all grouped rows.
参数项:
|
GroupingView | |
|
collapseAllGroups
(
)
Collapses all grouped rows.
Collapses all grouped rows.
参数项:
|
GroupingView | |
getGroupId
(
String value
)
: String
Dynamically tries to determine the ...
Dynamically tries to determine the groupId of a specific value
参数项:
|
GroupingView | |
getRow
(
Number index
)
: HtmlElement
指定一个行索引,返回该行的<TR> HtmlElement
指定一个行索引,返回该行的<TR> HtmlElement
参数项:
|
GridView | |
getCell
(
Number row,
Number col
)
: HtmlElement
指定一个单元格的坐标,返回该单元格的<TD> HtmlElement
指定一个单元格的坐标,返回该单元格的<TD> HtmlElement
参数项:
|
GridView | |
getHeaderCell
(
Number index
)
: HtmlElement
指定一个列索引,返回该列头部的单元格的<TD> HtmlElement
指定一个列索引,返回该列头部的单元格的<TD> HtmlElement
参数项:
|
GridView | |
|
scrollToTop
(
)
滚动grid到顶部
滚动grid到顶部
参数项:
|
GridView | |
focusRow
(
Number row
)
使指定的行得到焦点
使指定的行得到焦点
参数项:
|
GridView | |
focusCell
(
Number row,
Number col,
Boolean hscroll
)
使指定的单元格得到焦点
使指定的单元格得到焦点
参数项:
|
GridView | |
refresh
(
[Boolean headersToo]
)
刷新grid UI
刷新grid UI
参数项:
|
GridView | |
fireEvent
(
String eventName,
)
: Boolean
触发指定的事件,并将参数传入(至少要有事件名称)。
触发指定的事件,并将参数传入(至少要有事件名称)。
参数项:
|
Observable | |
addListener
(
String eventName,
Function handler,
[Object scope],
[Object options]
)
为该组件加入事件句柄(event handler)
为该组件加入事件句柄(event handler)
句柄函数执行时所在的作用域。句柄函数“this”的上下文。 触发事件后开始执行句柄的延时时间(invocation:the act of making a particular function start),单位:毫秒 true代表为下次事件触发加入一个要处理的句柄,然后再移除本身。 不同配搭方式的选项 一次调用加入上多个句柄(handlers) 或者是以简写的方式书写,前提是只允许同一个的作用域对象传入到所有的句柄中:
参数项:
|
Observable | |
removeListener
(
String eventName,
Function handler,
Object scope
)
移除侦听器
移除侦听器
参数项:
|
Observable | |
|
purgeListeners
(
)
从这个对象身上移除所有的侦听器
从这个对象身上移除所有的侦听器
参数项:
|
Observable | |
addEvents
(
Object object
)
定义观察者的事件。
定义观察者的事件。
参数项:
|
Observable | |
hasListener
(
String eventName
)
: Boolean
查询该对象是否有指定事件的侦听器
查询该对象是否有指定事件的侦听器
参数项:
|
Observable | |
|
suspendEvents
(
)
暂停触发所有的事件(参阅{@link #resumeEvents})
暂停触发所有的事件(参阅{@link #resumeEvents})
参数项:
|
Observable | |
|
resumeEvents
(
)
重新触发事件(参阅{@link #suspendEvents})
重新触发事件(参阅{@link #suspendEvents})
参数项:
|
Observable | |
Ext.util.Observable.prototype.on
(
String eventName,
[Object scope],
Function handler,
[Object options]
)
为该元素添加事件句柄(event handler),addListen...
为该元素添加事件句柄(event handler),addListener的简写方式 @param {String} eventName 侦听事件的类型 @param {Object} scope (可选的) 执行句柄的作用域 @param {Function} handler 事件涉及的方法 @param {Object} options (可选的) @method
参数项:
|
Observable | |
Ext.util.Observable.prototype.un
(
String eventName,
Function handler,
[Object scope]
)
移除侦听器 @param {String} eventName ...
移除侦听器 @param {String} eventName 侦听事件的类型 @param {Function} handler 事件涉及的方法 @param {Object} scope (可选的)句柄的作用域 @method
参数项:
|
Observable | |
Ext.util.Observable.capture
(
Observable o,
Function fn,
[Object scope]
)
. 开始捕捉特定的观察者。 在事件触发之前,所有的事件会...
. 开始捕捉特定的观察者。 在事件触发之前,所有的事件会以"事件名称+标准签名"的形式传入到函数(传入的参数是function类型)。 如果传入的函数执行后返回false,则接下的事件将不会触发。 @param {Observable} o 要捕捉的观察者 @param {Function} fn 要调用的函数 @param {Object} scope (可选的)函数作用域 @static
参数项:
|
Observable | |
Ext.util.Observable.releaseCapture
(
Observable o
)
从Observable身上移除所有已加入的捕捉captu...
从Observable身上移除所有已加入的捕捉captures @param {Observable} o 要释放的观察者 @static
参数项:
|
Observable | |