editable
:是否可编辑,默认为
true
editor
:编辑器
groupName
:
emptyGroupText
:
groupable
:
3
、
Ext.grid.ColumnModel
主要配置项:
columns
:字段数组
defaultSortable
:是否进行默认排序,默认为
false
defaultWidth
:默认宽度
主要方法:
findColumnIndex(
String
col
)
:根据给定的
dataIndex
查找列索引
getColumnById(
String
id
)
:取得指定
id
对应的列
getColumnCount(
Boolean
visibleOnly
)
:取得列总数
getColumnHeader(
Number
col
)
:取得列的表头
getColumnId(
Number
index
)
:取得列
id
getDataIndex(
Number
col
)
:取得列对应的数据字段名
getIndexById(
String
id
)
:取得列索引
getTotalWidth(
Boolean
includeHidden
)
isCellEditable(
Number
colIndex,
Number
rowIndex
)
isFixed()
isHidden(
Number
colIndex
)
setColumnHeader(
Number
col,
String
header
)
setColumnWidth(
Number
col,
Number
width,
Boolean
suppressEvent
)
setDataIndex(
Number
col,
String
dataIndex
)
setEditable(
Number
col,
Boolean
editable
)
setEditor(
Number
col,
Object
editor
)
setHidden(
Number
colIndex,
Boolean
hidden
)
setRenderer(
Number
col,
Function
fn
)
4
、
Ext.grid.AbstractSelectionModel
主要方法:
lock()
:锁定选择区域
unlock()
:解锁选择区域
isLocked()
:当前选择区域是否被锁定
5
、
Ext.grid.CellSelectionModel
主要方法:
clearSelections(
Boolean
preventNotify
)
:清除选择区域
getSelectedCell()
:取得当前选择的单元格,返回一数组,其格式:
[rowIndex,
colIndex]
hasSelection()
:当前是否有选择区域
select(
Number
rowIndex,
Number
colIndex,
[Boolean
preventViewNotify],
[Boolean
pre
ventFocus],
[Ext.data.Record
r]
)
:选择指定单元格
6
、
Ext.grid.RowSelectionModel
主要配置项:
singleSelect
:是否单选模式,默认为
false
,即可以选择多条数据
主要方法:
clearSelections(
[Boolean
fast]
)
:清除所有选择区域
deselectRange(
Number
startRow,
Number
endRow
)
:取消范围内的行选择
deselectRow(
Number
row,
[Boolean
preventViewNotify]
)
:取消指定行的选择状态
each(
Function
fn,
[Object
scope]
)
:遍历所有选择行,并调用指定函数。当前被选行将传入该函数
中
getCount()
:得到选择的总行数
getSelected()
:得到第一个被选记录
getSelections()
:得到所有被选记录的数组
hasNext()
:判断当前被选行之后是否还有记录可以选择
hasPrevious()
:判断当前被选行之前是否还有记录可以选择
hasSelection()
:是否已选择了数据
isIdSelected(
String
id
)
:判断指定
id
的记录是否被选择
isSelected(
Number/Record
index
)
:判断指定记录或记录索引的数据是否被选择
selectAll()
:选择所有行
selectFirstRow()
:选择第一行
selectLastRow(
[Boolean
keepExisting]
)
:选择最后行
keepExisting
:是否保持已有的选择
selectNext(
[Boolean
keepExisting]
)
:选择当前选择行的下一行
selectPrevious(
[Boolean
keepExisting]
)
:选择当前选择行的上一行
selectRange(
Number
startRow,
Number
endRow,
[Boolean
keepExisting]
)
:选择范围内的
所有行
selectRecords(
Array
records,
[Boolean
keepExisting]
)
:选择一组指定记录
selectRow(
Number
row,
[Boolean
keepExisting],
[Boolean
preventViewNotify]
)
:
选择一行
row
:行索引
selectRows(
Array
rows,
[Boolean
keepExisting]
)
:选择多行
rows
:行索引数组
7
、
Ext.grid.CheckboxSelectionModel
主要配置项:
singleSelect
:是否单选模式,默认为
false
,即可以选择多条数据
checkOnly
:是否只能通过点击
checkbox
列进行选择,默认为
false
sortable
:是否允许
checkbox
列排序,默认为
false
width
:
checkbox
列的宽度,默认为
20
8
、
Ext.grid.RowNumberer
主要配置项:
header
:行号列表头显示的内容
width
:列宽,默认为
23
9
、
Ext.grid.GridView
主要配置项:
enableRowBody
:是否包含行体
sortAscText
:表格标题菜单中升序的文字描述
sortDescText
:表格标题菜单中降序的文字描述
columnsText
:表格标题菜单中列对应的文字描述
autoFill
:是否自动扩展列以充满整个表格,默认为
false
forceFit
:是否强制调整表格列宽以适用表格的整体宽度,防止出现水平滚动条,默认为
false
主要方法:
focusCell(
Number
row,
Number
col
)
:将焦点移到指定单元格
focusRow(
Number
row
)
:将焦点移动指定行
getCell(
Number
row,
Number
col
)
:取得指定单元格对应的
td
元素
getHeaderCell(
Number
index
)
:取得指定表头对应的
td
元素
getRow(
Number
index
)
:取得指定行对应的
tr
元素
getRowClass(
Record
record,
Number
index,
Object
rowParams,
Store
store
)
:
得到附加到
表格行上的样式名
record
:当前行的数据记录对象
index
:当前行的索引
rowParams
:渲染时传入到行模板中的配置对象,通过它可以为行体定制样式,该对象只在
enableRow
Body
为
true
时才生效,可能的属性如下:
body
:渲染到行体中的
HTML
代码片段
bodyStyle
:应用到行体
tr
元素
style
属性的字符串
cols
:应用到行体
td
元素
colspan
属性的值,默认为总列数
store
:表格数据集
refresh(
[Boolean
headersToo]
)
:刷新表格组件
scrollToTop()
:滚动表格到顶端
editable
:是否可编辑,默认为
true
editor
:编辑器
groupName
:
emptyGroupText
:
groupable
:
3
、
Ext.grid.ColumnModel
主要配置项:
columns
:字段数组
defaultSortable
:是否进行默认排序,默认为
false
defaultWidth
:默认宽度
主要方法:
findColumnIndex(
String
col
)
:根据给定的
dataIndex
查找列索引
getColumnById(
String
id
)
:取得指定
id
对应的列
getColumnCount(
Boolean
visibleOnly
)
:取得列总数
getColumnHeader(
Number
col
)
:取得列的表头
getColumnId(
Number
index
)
:取得列
id
getDataIndex(
Number
col
)
:取得列对应的数据字段名
getIndexById(
String
id
)
:取得列索引
getTotalWidth(
Boolean
includeHidden
)
isCellEditable(
Number
colIndex,
Number
rowIndex
)
isFixed()
isHidden(
Number
colIndex
)
setColumnHeader(
Number
col,
String
header
)
setColumnWidth(
Number
col,
Number
width,
Boolean
suppressEvent
)
setDataIndex(
Number
col,
String
dataIndex
)
setEditable(
Number
col,
Boolean
editable
)
setEditor(
Number
col,
Object
editor
)
setHidden(
Number
colIndex,
Boolean
hidden
)
setRenderer(
Number
col,
Function
fn
)
4
、
Ext.grid.AbstractSelectionModel
主要方法:
lock()
:锁定选择区域
unlock()
:解锁选择区域
isLocked()
:当前选择区域是否被锁定
5
、
Ext.grid.CellSelectionModel
主要方法:
clearSelections(
Boolean
preventNotify
)
:清除选择区域
getSelectedCell()
:取得当前选择的单元格,返回一数组,其格式:
[rowIndex,
colIndex]
hasSelection()
:当前是否有选择区域
select(
Number
rowIndex,
Number
colIndex,
[Boolean
preventViewNotify],
[Boolean
pre
ventFocus],
[Ext.data.Record
r]
)
:选择指定单元格
6
、
Ext.grid.RowSelectionModel
主要配置项:
singleSelect
:是否单选模式,默认为
false
,即可以选择多条数据
主要方法:
clearSelections(
[Boolean
fast]
)
:清除所有选择区域
deselectRange(
Number
startRow,
Number
endRow
)
:取消范围内的行选择
deselectRow(
Number
row,
[Boolean
preventViewNotify]
)
:取消指定行的选择状态
each(
Function
fn,
[Object
scope]
)
:遍历所有选择行,并调用指定函数。当前被选行将传入该函数
中
getCount()
:得到选择的总行数
getSelected()
:得到第一个被选记录
getSelections()
:得到所有被选记录的数组
hasNext()
:判断当前被选行之后是否还有记录可以选择
hasPrevious()
:判断当前被选行之前是否还有记录可以选择
hasSelection()
:是否已选择了数据
isIdSelected(
String
id
)
:判断指定
id
的记录是否被选择
isSelected(
Number/Record
index
)
:判断指定记录或记录索引的数据是否被选择
selectAll()
:选择所有行
selectFirstRow()
:选择第一行
selectLastRow(
[Boolean
keepExisting]
)
:选择最后行
keepExisting
:是否保持已有的选择
selectNext(
[Boolean
keepExisting]
)
:选择当前选择行的下一行
selectPrevious(
[Boolean
keepExisting]
)
:选择当前选择行的上一行
selectRange(
Number
startRow,
Number
endRow,
[Boolean
keepExisting]
)
:选择范围内的
所有行
selectRecords(
Array
records,
[Boolean
keepExisting]
)
:选择一组指定记录
selectRow(
Number
row,
[Boolean
keepExisting],
[Boolean
preventViewNotify]
)
:
选择一行
row
:行索引
selectRows(
Array
rows,
[Boolean
keepExisting]
)
:选择多行
rows
:行索引数组
7
、
Ext.grid.CheckboxSelectionModel
主要配置项:
singleSelect
:是否单选模式,默认为
false
,即可以选择多条数据
checkOnly
:是否只能通过点击
checkbox
列进行选择,默认为
false
sortable
:是否允许
checkbox
列排序,默认为
false
width
:
checkbox
列的宽度,默认为
20
8
、
Ext.grid.RowNumberer
主要配置项:
header
:行号列表头显示的内容
width
:列宽,默认为
23
9
、
Ext.grid.GridView
主要配置项:
enableRowBody
:是否包含行体
sortAscText
:表格标题菜单中升序的文字描述
sortDescText
:表格标题菜单中降序的文字描述
columnsText
:表格标题菜单中列对应的文字描述
autoFill
:是否自动扩展列以充满整个表格,默认为
false
forceFit
:是否强制调整表格列宽以适用表格的整体宽度,防止出现水平滚动条,默认为
false
主要方法:
focusCell(
Number
row,
Number
col
)
:将焦点移到指定单元格
focusRow(
Number
row
)
:将焦点移动指定行
getCell(
Number
row,
Number
col
)
:取得指定单元格对应的
td
元素
getHeaderCell(
Number
index
)
:取得指定表头对应的
td
元素
getRow(
Number
index
)
:取得指定行对应的
tr
元素
getRowClass(
Record
record,
Number
index,
Object
rowParams,
Store
store
)
:
得到附加到
表格行上的样式名
record
:当前行的数据记录对象
index
:当前行的索引
rowParams
:渲染时传入到行模板中的配置对象,通过它可以为行体定制样式,该对象只在
enableRow
Body
为
true
时才生效,可能的属性如下:
body
:渲染到行体中的
HTML
代码片段
bodyStyle
:应用到行体
tr
元素
style
属性的字符串
cols
:应用到行体
td
元素
colspan
属性的值,默认为总列数
store
:表格数据集
refresh(
[Boolean
headersToo]
)
:刷新表格组件
scrollToTop()
:滚动表格到顶端