使用范围:UI2
Contents
component Grid ($UI/system/components/justep/grid/grid) extends ViewComponent
Constructor Top
Grid () | |||
Grid ( options) |
Constants Top
const string |
virtualRootID
虚根行ID |
Attributes Top
string |
altclass
自定义交替行样式class | ||
boolean |
altRows
使用交替行样式,默认值:false | ||
string |
appearance
显示样式,取值范围:grid、treeGrid、tree,默认值:grid | ||
string |
caption
标题 | ||
boolean |
cascade
树形多选级联选择,默认值:false | ||
string |
checkedclass
多选checked的class | ||
string |
class
组件class | ||
string |
data
关联的data组件xid | ||
boolean |
directEdit
直接进入编辑,否则双击进入编辑,默认值:true | ||
string |
expandColumn
树形的展开列 | ||
string |
filter
数据过滤表达式,表达式中可以使用$model,$object,$parent,$row(执行过滤的数据行对象)变量 | ||
integer |
frozenColumnCount
冻结列数 | ||
integer |
height
高度,当使用auto时自动根据内容进行展现,当使用100%时自动使用父容器高度 | ||
boolean |
hiddenCaptionbar
隐藏标题栏,默认值:false | ||
boolean |
multiboxonly
仅使用checkBox多选,默认值:false | ||
boolean |
multiselect
使用checkBox多选,默认值:false | ||
integer |
multiselectWidth
多选列宽,默认值:20 | ||
string |
rowAttr
| ||
integer |
rowNumberWidth
行号列宽,默认值:20 | ||
boolean |
serverSort
服务端排序,默认值:true | ||
boolean |
showRowNumber
显示行号,默认值:false | ||
boolean |
useFilterBar
使用过滤条,默认值:false | ||
boolean |
useFooter
使用footer,默认值:false,打开后可以通过api:setFooterData设置footer显示内容 | ||
boolean |
useVirtualRoot
树形展现使用虚根,默认值:false | ||
string |
virtualRootLabel
树形展现虚根名称 | ||
integer |
width
宽度,当使用auto时自动根据内容进行展现,当使用100%时自动使用父容器宽度 | ||
string |
xid
组件标示 |
Static Methods Top
boolean | isVirtualRoot (string rowID) |
Methods Top
void | addRow (Row row) | |
void | collapseAll () | |
void | collapseRow (string rowID) | |
void | deleteRow (string rowID) | |
void | editCell (TD cell) | |
void | editStop () | |
void | expandAll () | |
void | expandByIDPath (string path) | |
void | expandLevel (int level) | |
void | expandRow (string rowID) | |
td | getCell (string rowID, string col) | |
integer | getCellIndex (Dom td) | |
list<Row> | getCheckedRows () | |
list |
getCheckeds () | |
object | getColDef (integer colIndex) | |
integer | getColIndex (string colName) | |
string | getColName (integer colIndex) | |
integer | getColWidth (string col) | |
Data | getData () | |
Row | getDataRow (node node) | |
string | getFilter () | |
integer | getFooterHeight () | |
object | getGridParam (string name) | |
integer | getHeaderHeight () | |
integer | getHeight () | |
void | getNextCell (TD cell) | |
TR | getRowByID (string rowID) | |
string | getSelection () | |
integer | getWidth () | |
void | groupBy (string col) | |
void | groupByRemove (string col) | |
void | hideCol (string col) | |
boolean | isChecked (string rowID) | |
boolean | isExpanded (string rowID) | |
boolean | isGrouping () | |
boolean | isMultiSelect () | |
boolean | isTree () | |
boolean | isTreeGrid () | |
void | nextEditCell (TD cell) | |
void | refresh () | |
void | selectVirtualRoot () | |
void | setCaption (string caption) | |
void | setCell (string rowID, string col, object css, object attr) | |
void | setColWidth (string col, integer width) | |
void | setFilter (string filter) | |
void | setFooterData (object footerData) | |
void | setGridParam (object params) | |
void | setHeadCheckBox (boolean checked) | |
void | setHeight (integer height) | |
void | setLabel (string colName, string label, string | object css, object attr) | |
void | setRowChecked (string rowID, boolean checked) | |
void | setRowCss (string rowID, object css) | |
void | setSelection (string rowID) | |
void | setWidth (integer width) | |
void | showCol (string col) |
Events Top
Constructor details
Top
public
Grid
()
使用场景:展示网格或树形数据,可以分页显示数据;
使用方法:在页面上添加grid组件,绑定显示的data数据,可以设置分组,设置多列头;
##
文档链接:#http://docs.newdao.net/zhuo-mian-nei-rong-zu-jian/fu-za-biao-ge.html#
public
Grid
( options)
构造函数
Inherited from ViewComponent
参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
构造函数
Inherited from ViewComponent
参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
Constants Detail Top
static
public
string
virtualRootID
虚根行ID
Static Methods Detail Top
static
public
boolean
isVirtualRoot
(string rowID)
判断是否虚根
Attributes Detail Top
public
string
altclass
自定义交替行样式class
public
boolean
altRows
使用交替行样式,默认值:false
public
string
appearance
显示样式,取值范围:grid、treeGrid、tree,默认值:grid
public
string
caption
标题
public
boolean
cascade
树形多选级联选择,默认值:false
public
string
checkedclass
多选checked的class
public
string
class
组件class
扩展样式: x-grid-no-bordered 列头对齐方式: x-grid-title-center,x-grid-title-left,x-grid-title-right,x-grid-title-justify
public
string
data
关联的data组件xid
public
boolean
directEdit
直接进入编辑,否则双击进入编辑,默认值:true
public
string
expandColumn
树形的展开列
public
string
filter
数据过滤表达式,表达式中可以使用$model,$object,$parent,$row(执行过滤的数据行对象)变量
public
integer
frozenColumnCount
冻结列数
public
integer
height
高度,当使用auto时自动根据内容进行展现,当使用100%时自动使用父容器高度
public
boolean
hiddenCaptionbar
隐藏标题栏,默认值:false
public
boolean
multiboxonly
仅使用checkBox多选,默认值:false
public
boolean
multiselect
使用checkBox多选,默认值:false
public
integer
multiselectWidth
多选列宽,默认值:20
public
string
rowAttr
public
integer
rowNumberWidth
行号列宽,默认值:20
public
boolean
serverSort
服务端排序,默认值:true
public
boolean
showRowNumber
显示行号,默认值:false
public
boolean
useFilterBar
使用过滤条,默认值:false
public
boolean
useFooter
使用footer,默认值:false,打开后可以通过api:setFooterData设置footer显示内容
public
boolean
useVirtualRoot
树形展现使用虚根,默认值:false
public
string
virtualRootLabel
树形展现虚根名称
public
integer
width
宽度,当使用auto时自动根据内容进行展现,当使用100%时自动使用父容器宽度
public
string
xid
组件标示
Methods Detail Top
public
void
addRow
(Row row)
增加行
public
void
collapseAll
()
所有行折叠
public
void
collapseRow
(string rowID)
行折叠
public
void
deleteRow
(string rowID)
删除行
public
void
editCell
(TD cell)
单元格进入编辑状态,受列上定义的editable属性和data的readonly规则影响
public
void
editStop
()
单元格结束编辑
public
void
expandAll
()
所有行展开,注意:当数据较多时有可能引发性能问题,慎重使用
public
void
expandByIDPath
(string path)
根据ID路径行展开
public
void
expandLevel
(int level)
展开到第level层,注意:当数据较多时有可能引发性能问题,慎重使用
public
void
expandRow
(string rowID)
行展开
public
td
getCell
(string rowID, string col)
获取cell
public
integer
getCellIndex
(Dom td)
获取列索引
返回多选选中的行
public
list
getCheckeds
()
返回多选选中的行ID
public
object
getColDef
(integer colIndex)
获取列定义
public
integer
getColIndex
(string colName)
获取列索引
public
string
getColName
(integer colIndex)
获取列名
public
integer
getColWidth
(string col)
获取列宽
获取grid绑定的data对象
根据行html节点获取bind的Data行对象
public
string
getFilter
()
获取DataTables绑定的data filter表达式
public
integer
getFooterHeight
()
获取脚高
public
object
getGridParam
(string name)
获取参数值
public
integer
getHeaderHeight
()
获取头高
public
integer
getHeight
()
获取grid高
public
void
getNextCell
(TD cell)
获取下一个单元格,没有时返回null
public
TR
getRowByID
(string rowID)
根据行ID获取TR
public
string
getSelection
()
返回选中行的ID
public
integer
getWidth
()
获取grid宽
public
void
groupBy
(string col)
指定分组
public
void
groupByRemove
(string col)
去除分组
public
void
hideCol
(string col)
隐藏grid列
public
boolean
isChecked
(string rowID)
多选是否选中行
public
boolean
isExpanded
(string rowID)
判断行是否展开
public
boolean
isGrouping
()
是否使用分组
public
boolean
isMultiSelect
()
是否多选
public
boolean
isTree
()
是否tree
public
boolean
isTreeGrid
()
是否treeGrid,当tree时也返回true
public
void
nextEditCell
(TD cell)
下一个可以编辑的单元格进入编辑状态
public
void
refresh
()
重新刷新grid
public
void
selectVirtualRoot
()
选中虚根
public
void
setCaption
(string caption)
设置标题
public
void
setCell
(string rowID, string col, object css, object attr)
设置单元格样式或者属性
public
void
setColWidth
(string col, integer width)
设置单元格
public
void
setFilter
(string filter)
设置data filter表达式
public
void
setFooterData
(object footerData)
设置footer数据
public
void
setGridParam
(object params)
设置参数值
public
void
setHeadCheckBox
(boolean checked)
多选时设置列头多选checkbox状态
public
void
setHeight
(integer height)
设置grid高
public
void
setLabel
(string colName, string label, string | object css, object attr)
设置列显示名,当多表头时此函数无效
public
void
setRowChecked
(string rowID, boolean checked)
设置行多选状态
public
void
setRowCss
(string rowID, object css)
设置行的css
public
void
setSelection
(string rowID)
设置选中行
public
void
setWidth
(integer width)
设置grid宽
public
void
showCol
(string col)
显示grid列
Events Detail Top
[回调型事件]创建grid组件前事件
[回调型事件]选中行前,通过cancel可控制选中
[回调型事件]单元格显示渲染
[回调型事件]树形行折叠
[回调型事件]树形行展开
[回调型事件]grid分组标题显示渲染
[回调型事件]行索引变化
[回调型事件]创建grid组件事件
[回调型事件]directEdit=true时最后一行最后一个单元格回车后触发事件
[回调型事件]grid重新加载
[回调型事件]多选勾选时,可以使用cancel取消
[回调型事件]多选勾选后
[回调型事件]多选全选
[回调型事件]单击行事件
[回调型事件]双击行事件
[回调型事件]选中行
[回调型事件]树形图标渲染