new F.Grid(options)
F.Grid.js, line 52
表格控件
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
初始参数
|
Example
创建一个表格,使用内联数据:
F.create({
type: 'grid', id: 'grid1', renderTo: '#wrap1', title: '表格',
columns: [{
columnType: 'rownumberfield'
}, {
text: '姓名', field: 'name'
}, {
text: '性别', field: 'gender'
}, {
text: '是否在校', field: 'atSchool', columnType: 'checkboxfield'
}, {
text: '所学专业', field: 'major', flex: 1,
renderer: function (value, params) {
return '' + value + '';
}
}],
fields: ["name", "gender", "entranceYear", "atSchool", "major", "logTime"],
data: [
["张萍萍", "女", "2000", true, "材料科学与工程系", "2015-03-10"],
["陈飞", "男", "2000", false, "化学系", "2015-03-10"],
["董婷婷", "女", "2000", true, "化学系", "2015-03-10"],
["刘国", "男", "2002", false, "化学系", "2015-03-10"],
["康颖颖", "女", "2008", true, "数学系", "2015-04-19"],
["彭博", "男", "2008", false, "数学系", "2015-04-29"]
]
});
Extends
Members
-
bodyEljQuery
-
控件主体对应的jQuery节点对象
-
eljQuery
-
控件对应的jQuery节点对象
-
itemsObject
-
子控件列表
Methods
-
inherited add(value)
F.Container.js, line 55 -
添加新的子控件到当前控件
Name Type Description valueObject | Array.<Object> 控件实例数组 Example
menu1.add(['-', { type: 'menuitem', text: '新菜单项' }]); -
addNewRecord(id, text, record, appendToEnd, editColumnId){string}
F.Grid.cellEditing.js, line 205 -
添加一条新记录
Name Type Description idstring optional 行标识符 textstring optional 行文本 recordObject 新记录对象 appendToEndboolean | number 是否添加到行尾部(如果是数字,则表示插入的位置) editColumnIdstring | boolean 添加后立即进入编辑状态的列标识符(如果传入布尔值false,则不进入编辑状态) Returns:
Type Description string 行标识符 Examples
添加一条新记录
F.ui.grid1.addNewRecord({ "Name": "张三", "Gender": "1", "Major": "化学系" }, true);添加一条新记录(包含行标识符和行文本)
F.ui.grid1.addNewRecord({"104", "张三", { "Name": "张三", "Gender": "1", "Major": "化学系" }, true);添加一条新记录(包含行标识符和行文本)
F.ui.grid1.addNewRecord({ "id": "104", "text": "张三", "values": { "Name": "张三", "Gender": "1", "Major": "化学系" } }, true);添加一条新记录(包含行标识符、行文本和禁用行选择)
F.ui.grid1.addNewRecord({ "id": "104", "text": "张三", "unselectable": true, "values": { "Name": "张三", "Gender": "1", "Major": "化学系" } }, true); -
addNewRecords(records, appendToEnd)
F.Grid.cellEditing.js, line 154 -
添加多条新记录
Name Type Description recordsObject 新记录对象数组 appendToEndboolean | number 是否添加到行尾部(如果是数字,则表示插入的位置) Examples
添加两条新记录
F.ui.grid1.addNewRecords([{ "Name": "张三", "Gender": "1", "Major": "化学系" }, { "Name": "李诗诗", "Gender": "2", "Major": "物理系" }], true);添加两条新记录(包含行标识符和行文本)
F.ui.grid1.addNewRecords([{ "id": "104", "text": "张三", "values": { "Name": "张三", "Gender": "1", "Major": "化学系" } }, { "id": "105", "text": "李诗诗", "values": { "Name": "李诗诗", "Gender": "2", "Major": "物理系" } }], true); -
inherited addTool(item)
F.PanelBase.js, line 171 -
添加工具图标
Name Type Description itemF.Tool 工具图标实例 -
appendData(data)
F.Grid.loadData.js, line 45 -
追加数据
Name Type Description dataArray.<Object> 数据 -
calcSummaryValue(columnId, summaryType)
F.Grid.js, line 1162 -
计算合计行的值
Name Type Default Description columnIdstring 列标识符 summaryTypestring 'sum' 合计行类型(可选项为:sum, min, max, count, avg) -
cancelEdit()
F.Grid.cellEditing.js, line 114 -
取消正在编辑的单元格
-
clearData()
F.Grid.js, line 964 -
清空全部数据
-
clearDirty()
F.Grid.js, line 1188 -
不支持此方法
-
clearSelection()
F.Grid.js, line 956 -
清空全部选中行、单元格
-
inherited collapse()
F.PanelBase.js, line 194 -
折叠面板
-
collapseRow(row, deep)
F.Grid.js, line 722 -
折叠行(适用于树表格和行分组)
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 deepboolean 是否递归调用子节点(仅树表格有效) -
collapseRowExpander(row)
F.Grid.js, line 812 -
折叠行扩展列
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 -
collapseRowExpanders(rows)
F.Grid.js, line 827 -
折叠行扩展列
Name Type Description rowsArray.<number> | Array.<string> | Array.<jQuery> 行索引数组、行标识符数组或者行元素数组 -
collapseRows()
F.Grid.js, line 728 -
折叠全部行(适用于树表格和行分组)
-
commitChanges()
F.Grid.cellEditing.js, line 212 -
提交所有改动
-
configColumns(columns, options)
F.Grid.js, line 1153 -
重新配置表格列
Name Type Description columnsArray.<Object> 表格列集合 optionsObject 参数 Name Type Default Description idFieldboolean '' 标识行 id 的字段名称 textFieldboolean '' 标识行 text 的字段名称 multiSelectboolean true 是否允许多选 checkboxSelectboolean false 是否启用多选框列 -
deleteRow(row, forceUpdate)
F.Grid.js, line 921 -
删除行
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 forceUpdateboolean 是否强制更新(强制更新时从数据源中删除行) -
deleteRows(rowIds, forceUpdate)
F.Grid.js, line 929 -
删除多行
Name Type Description rowIdsArray.<number> | Array.<string> | Array.<jQuery> 行索引数组、行标识符数组或者行元素数组 forceUpdateboolean 是否强制更新(强制更新时从数据源中删除行) -
deleteSelectedRows(forceUpdate)
F.Grid.js, line 911 -
删除选中的行
Name Type Description forceUpdateboolean 是否强制更新(强制更新时从数据源中删除行) -
deselectAllRows()
F.Grid.js, line 681 -
取消选中全部行
-
deselectRow(row)
F.Grid.js, line 668 -
取消选中行
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 -
deselectRows(rowIds)
F.Grid.js, line 675 -
取消选中多行
Name Type Description rowIdsArray.<number> | Array.<string> | Array.<jQuery> 行索引数组、行标识符数组或者行元素数组 -
inherited disable()
F.PanelBase.js, line 102 -
禁用控件
-
inherited doLayout(startFormTopmostComonent)
F.Component.js, line 122 -
执行布局操作
Name Type Default Description startFormTopmostComonentboolean false optional 从最顶层的控件开始布局 -
inherited enable()
F.PanelBase.js, line 108 -
启用控件
-
inherited expand()
F.PanelBase.js, line 200 -
展开面板
-
expandPath(path)
F.Grid.js, line 689 -
展开路径(仅树表格有效)
Name Type Description pathstring 指定的路径 -
expandRow(row, deep)
F.Grid.js, line 707 -
展开行(适用于树表格和行分组)
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 deepboolean 是否递归调用子节点(仅树表格有效) -
expandRowExpander(row)
F.Grid.js, line 805 -
展开行扩展列
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 -
expandRowExpanders(rows)
F.Grid.js, line 820 -
展开行扩展列
Name Type Description rowsArray.<number> | Array.<string> | Array.<jQuery> 行索引数组、行标识符数组或者行元素数组 -
expandRowPath(row)
F.Grid.js, line 697 -
展开行所在路径(仅树表格有效)
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 -
expandRows()
F.Grid.js, line 713 -
展开全部行(适用于树表格和行分组)
-
inherited getAttr(key){string}
F.Component.js, line 101 -
获取节点属性
Name Type Description keystring 节点属性键 Returns:
Type Description string 节点属性值 -
getCellData(row, columnId){Object}
F.Grid.js, line 487 -
获取单元格数据
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 columnIdstring 列标识符 Returns:
Type Description Object 单元格数据 -
getCellEl(row, columnId){jQuery}
F.Grid.js, line 576 -
获取单元格元素
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 columnIdstring 列标识符 Returns:
Type Description jQuery 单元格元素 -
getCellValue(row, columnId){Object}
F.Grid.js, line 476 -
获取单元格的值
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 columnIdstring 列标识符 Returns:
Type Description Object 单元格的值 -
getCheckedRows(){Array.<string>}
F.Grid.js, line 949 -
获取选中的行标识符数组(仅适用于树表格)
Returns:
Type Description Array.<string> 行标识符数组 -
getColumn(column){Object}
F.Grid.js, line 532 -
获取列对象
Name Type Description columnstring | jQuery 列标识符、单元格元素 Returns:
Type Description Object 列对象 -
getColumnHeaderEl(columnId){jQuery}
F.Grid.js, line 508 -
获取列的标题栏元素
Name Type Description columnIdstring 列标识符 Returns:
Type Description jQuery 列的标题栏元素 -
getColumnHeaderEls(){jQuery}
F.Grid.js, line 500 -
获取所有列的标题栏元素
Returns:
Type Description jQuery 所有列的标题栏元素 -
getColumnId(column){Object}
F.Grid.js, line 524 -
获取列标识符
Name Type Description columnjQuery 单元格元素 Returns:
Type Description Object 列标识符 -
getColumnIds(){Array.<string>}
F.Grid.js, line 540 -
获取列标识符数组
Returns:
Type Description Array.<string> 列标识符数组 -
getDeletedRows(){Array.<string>}
F.Grid.js, line 935 -
获取删除的行标识符数组
Returns:
Type Description Array.<string> 行标识符数组 -
getEndRowIndex(){number}
F.Grid.js, line 1069 -
获取当前页的结束索引值
Returns:
Type Description number 当前页的结束索引值 -
getExpandedRows(){Array.<string>}
F.Grid.js, line 942 -
获取展开的行标识符数组(仅适用于树表格)
Returns:
Type Description Array.<string> 行标识符数组 -
getField(fieldName){string|Object}
F.Grid.js, line 426 -
获取字段对象
Name Type Description fieldNamestring | Number 字段名称或者索引 Returns:
Type Description string | Object 字段名称或者字段对象 -
getFilteredData(){Object}
F.Grid.headerMenuFilter.js, line 32 -
获取过滤参数
Returns:
Type Description Object 过滤参数 -
getFormFields()
F.Grid.js, line 1176 -
不支持此方法
-
inherited getHeight(){number}
F.Component.js, line 136 -
获取控件高度
Returns:
Type Description number 高度 -
getHiddenColumns(returnColumnData){Array.<string>}
F.Grid.js, line 854 -
获取隐藏的列标识符数组
Name Type Description returnColumnDataboolean 返回包含列对象的数组,否则返回包含列标识符的数组 Returns:
Type Description Array.<string> 隐藏的列标识符数组 -
inherited getIconEl(){jQuery}
F.PanelBase.js, line 143 -
获取图标元素
Returns:
Type Description jQuery 图标元素 -
inherited getIFrameEl(){jQuery}
F.PanelBase.js, line 253 -
获取内联框架元素
Returns:
Type Description jQuery 内联框架元素 -
inherited getIFrameUrl(){string}
F.PanelBase.js, line 246 -
获取内联框架地址
Returns:
Type Description string 内联框架地址 -
inherited getIFrameWindow(){Window}
F.PanelBase.js, line 260 -
获取内联框架窗体对象
Returns:
Type Description Window 内联框架窗体对象 -
inherited getItem(value){F.Component}
F.Container.js, line 112 -
获取子控件
Name Type Description valuenumber | string | function 子控件索引、标识符或者函数 Returns:
Type Description F.Component 子控件实例 -
getMergedData()
F.Grid.cellEditing.js, line 234 -
获取合并后的值(排除删除行数据)
-
getModifiedData()
F.Grid.cellEditing.js, line 228 -
获取修改的值
-
getNextCellEl(td, verticalNavigate, multiRowsNavigate)
F.Grid.js, line 1130 -
获取下一单元格
Name Type Default Description tdjQuery 单元格元素 verticalNavigateboolean false 垂直方向导航(默认为false) multiRowsNavigateboolean false 跨行导航(默认为false) -
getNextRowEl(tr)
F.Grid.js, line 1112 -
获取下一行
Name Type Description trjQuery 行元素 -
getPageCount(){number}
F.Grid.js, line 1076 -
获取总页数
Returns:
Type Description number 总页数 -
getPagedData(){Array.<Object>}
F.Grid.js, line 1104 -
获取分页数据
Returns:
Type Description Array.<Object> 分页数据 -
getPageIndex(){number}
F.Grid.js, line 1083 -
获取当前页的索引值
Returns:
Type Description number 当前页的索引值 -
getPageSize(){number}
F.Grid.js, line 1090 -
获取每页显示记录数
Returns:
Type Description number 每页显示记录数 -
getPrevCellEl(td, verticalNavigate, multiRowsNavigate)
F.Grid.js, line 1140 -
获取上一单元格
Name Type Default Description tdjQuery 单元格元素 verticalNavigateboolean false 垂直方向导航(默认为false) multiRowsNavigateboolean false 跨行导航(默认为false) -
getPrevRowEl(tr)
F.Grid.js, line 1120 -
获取上一行
Name Type Description trjQuery 行元素 -
getRecordCount(){number}
F.Grid.js, line 1097 -
获取总记录数
Returns:
Type Description number 总记录数 -
getRowData(row){Object}
F.Grid.js, line 447 -
获取行数据
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 Returns:
Type Description Object 行数据 -
getRowEl(row, includeLockedTable){jQuery}
F.Grid.js, line 565 -
获取行元素
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 includeLockedTableboolean 是否包含锁定表格中的行 Returns:
Type Description jQuery 行元素 -
getRowEls(includeLockedTable){jQuery}
F.Grid.js, line 614 -
获取行元素
Name Type Description includeLockedTableboolean 是否包含锁定表格中的行元素 Returns:
Type Description jQuery 行元素 -
getRowId(row){string}
F.Grid.js, line 436 -
获取行标识符
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 Returns:
Type Description string 行标识符 -
getRowPath(row){string}
F.Grid.js, line 466 -
获取行路径(仅适用于树表格,返回类似 frow11/frow23/frow60 的字符串)
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 Returns:
Type Description string 行路径 -
getRowValue(row){Object}
F.Grid.js, line 457 -
获取行值(列标识符和值的键值对)
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 Returns:
Type Description Object 行值 -
inherited getScrollEl(){jQuery}
F.PanelBase.js, line 115 -
获取可滚动元素
Returns:
Type Description jQuery 可滚动元素 -
getSelectedCell(returnCellData){Array.<string>}
F.Grid.js, line 895 -
获取选中的单元格
Name Type Description returnCellDataboolean 返回单元格对象,否则返回标识单元格的数组 Returns:
Type Description Array.<string> 选中的单元格([行标识符, 列标识符]) -
getSelectedCellColumnId(){string}
F.Grid.js, line 903 -
获取选中单元格的列ID
Returns:
Type Description string 选中的单元格所在的列标识符 -
getSelectedCellEl()
F.Grid.js, line 886 -
获取选中的单元格元素
-
getSelectedRow(returnRowData){string}
F.Grid.js, line 758 -
获取选中的行标识符
Name Type Description returnRowDataboolean 返回包含行对象的数组,否则返回包含行标识符的数组 Returns:
Type Description string 列标识符 -
getSelectedRowEl(includeLockedRows){jQuery}
F.Grid.js, line 774 -
获取选中的行元素
Name Type Description includeLockedRowsboolean 是否包含锁定表格的行元素 Returns:
Type Description jQuery 选中的行元素 -
getSelectedRowEls(includeLockedRows){jQuery}
F.Grid.js, line 766 -
获取选中的行元素
Name Type Description includeLockedRowsboolean 是否包含锁定表格的行元素 Returns:
Type Description jQuery 选中的行元素 -
getSelectedRows(returnRowData){Array.<string>}
F.Grid.js, line 749 -
获取选中的行标识符数组
Name Type Description returnRowDataboolean 返回包含行对象的数组,否则返回包含行标识符的数组 Returns:
Type Description Array.<string> 列标识符数组 -
getSortColumn(sortField){Object}
F.Grid.js, line 516 -
获取排序列对象
Name Type Description sortFieldstring 排序字段 Returns:
Type Description Object 列对象 -
getStartRowIndex(){number}
F.Grid.js, line 1062 -
获取当前页的开始索引值
Returns:
Type Description number 当前页的开始索引值 -
inherited getTitle(){string}
F.PanelBase.js, line 218 -
获取面板标题
Returns:
Type Description string 标题文本 -
inherited getTitleTooltip(){string}
F.PanelBase.js, line 225 -
获取面板标题提示信息
Returns:
Type Description string 标题提示信息 -
inherited getTooltip(){string}
F.Component.js, line 196 -
获取提示信息
Returns:
Type Description string 提示信息 -
getVisibleColumnCount(){number}
F.Grid.js, line 493 -
获取可见列的数量
Returns:
Type Description number 可见列的数量 -
inherited getWidth(){number}
F.Component.js, line 130 -
获取控件宽度
Returns:
Type Description number 宽度 -
inherited hasHScrollbar(){boolean}
F.PanelBase.js, line 122 -
是否存在水平滚动条
Returns:
Type Description boolean 是否存在水平滚动条 -
inherited hasIcon(){boolean}
F.PanelBase.js, line 137 -
是否有图标
Returns:
Type Description boolean 是否有图标 -
hasSelection(){boolean}
F.Grid.js, line 782 -
是否有选中行
Returns:
Type Description boolean 是否有选中行 -
inherited hasVScrollbar(){boolean}
F.PanelBase.js, line 130 -
是否存在垂直滚动条
Returns:
Type Description boolean 是否存在垂直滚动条 -
inherited hide()
F.PanelBase.js, line 273 -
隐藏面板
-
hideColumn(columnId, hidden)
F.Grid.js, line 869 -
隐藏列
Name Type Description columnIdstring 列标识符 hiddenboolean 是否隐藏 -
inherited hideLoading()
F.Container.js, line 95 -
隐藏加载动画
-
inherited insert(insertIndex, value)
F.Container.js, line 44 -
插入新的子控件到当前控件
Name Type Description insertIndexnumber 插入的位置 valueObject | Array.<Object> 控件实例数组 Example
menu1.insert(0, ['-', { type: 'menuitem', text: '新菜单项' }]); -
inherited insertTool(item, insertIndex)
F.PanelBase.js, line 179 -
插入工具图标
Name Type Description itemF.Tool 工具图标实例 insertIndexnumber 插入的位置 -
isAllSelected(){boolean}
F.Grid.js, line 789 -
是否所有行都处于选中状态
Returns:
Type Description boolean 是否所有行都处于选中状态 -
inherited isCollapsed(){boolean}
F.PanelBase.js, line 188 -
是否处于折叠状态
Returns:
Type Description boolean 折叠状态 -
isDirty()
F.Grid.js, line 1184 -
不支持此方法
-
inherited isDisabled(){boolean}
F.Component.js, line 224 -
是否禁用
Returns:
Type Description boolean 是否禁用 -
inherited isType(value){boolean}
F.Base.js, line 23 -
检测当前实例是否指定的控件类型
Name Type Description valueObject 控件类型 Returns:
Type Description boolean 如果当前实例是指定的控件类型,返回true;否则返回false Example
grid1.isType('panel') // 返回true grid1.isType('grid') // 返回true -
isValid()
F.Grid.js, line 1180 -
不支持此方法
-
inherited isVisible(){boolean}
F.Component.js, line 216 -
是否可见
Returns:
Type Description boolean 是否可见 -
loadData(parentRowId, data, summaryData)
F.Grid.loadData.js, line 36 -
加载数据
Name Type Description parentRowIdstring optional 加载节点数据(仅适用于树表格) dataArray.<Object> 数据 summaryDataArray.<Object> 汇总数据 -
loadDataUrl(dataUrl, dataParams)
F.Grid.loadData.js, line 55 -
加载数据
Name Type Description dataUrlstring optional 数据源地址 dataParamsobject 参数 -
loadPageData(pageIndex)
F.Grid.js, line 416 -
加载分页数据(仅适用于客户端数据分页)
Name Type Description pageIndexnumber 分页序号 -
loadSortData(pageIndex)
F.Grid.js, line 409 -
加载排序数据(仅适用于客户端数据排序)
Name Type Description pageIndexnumber 分页序号 -
lockColumn(columnId)
F.Grid.js, line 838 -
锁定列
Name Type Description columnIdstring 列标识符 -
mergeCells(cells)
F.Grid.js, line 990 -
合并单元格
Name Type Description cellsArray.<Object> 需要合并的单元格数组 Example
F.ui.grid1.mergeCells([{ rowId: 'row1', columnId: 'entranceYear', rowspan: 3 }, { rowId: 'row1', columnId: 'major', rowspan: 3 }, { rowId: 'row8', columnId: 'group', rowspan: 4, colspan: 2 }]); -
mergeColumns(columns, options)
F.Grid.js, line 1004 -
合并列
Name Type Description columnsArray.<string> 需要合并的列标识符数组 optionsObject 合并参数 Name Type Description dependsboolean 后一列的单元格合并取决于前一列的合并状态 dependsFirstboolean 后一列的单元格合并取决于第一列的合并状态 Example
F.ui.grid1.mergeColumns(['Major', 'Group', 'LogTime']); -
moveRowDown(row)
F.Grid.js, line 590 -
行下移
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 -
moveRowsDown(rows)
F.Grid.js, line 604 -
多行下移
Name Type Description rowsArray.<number> | Array.<string> | Array.<jQuery> 行索引数组、行标识符数组或者行元素数组 -
moveRowsUp(rows)
F.Grid.js, line 597 -
多行上移
Name Type Description rowsArray.<number> | Array.<string> | Array.<jQuery> 行索引数组、行标识符数组或者行元素数组 -
moveRowUp(row)
F.Grid.js, line 583 -
行上移
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 -
inherited off(eventNames, fn)
F.Component.js, line 181 -
移除事件
Name Type Description eventNamesstring 事件名称(可以空格分割多个事件名称) fnF_Component_on 之前注册的事件处理函数 -
inherited on(eventNames, fn)
F.Component.js, line 174 -
注册事件
Name Type Description eventNamesstring 事件名称(可以空格分割多个事件名称) fnF_Component_on 触发事件时执行的函数 -
inherited refreshIFrame()
F.PanelBase.js, line 267 -
刷新内联框架
-
rejectChanges()
F.Grid.cellEditing.js, line 220 -
拒绝所有改动
-
inherited remove()
F.Component.js, line 115 -
删除父控件中移除当前控件
-
inherited removeAttr(key)
F.Component.js, line 108 -
删除节点属性
Name Type Description keystring 节点属性键 -
inherited removeTooltip()
F.Component.js, line 208 -
删除提示信息
-
reset()
F.Grid.js, line 1192 -
不支持此方法
-
resetFilter(columnId)
F.Grid.headerMenuFilter.js, line 47 -
重置某个列的过滤参数
Name Type Description columnIdstring 列标识符 -
resetFilters()
F.Grid.headerMenuFilter.js, line 39 -
重置过滤参数
-
resolveColumn(fn)
F.Grid.js, line 555 -
遍历列
Name Type Description fnF_Grid_resolveColumn 遍历列的回调函数 -
resolveRow(fn, row)
F.Grid.js, line 1032 -
遍历行
Name Type Description fnF_Grid_resolveRow 遍历行的回调函数 rownumber | string | jQuery | Array optional 行索引、行标识符、行元素或者包含行数据的数组(如果留空则为全部行数据) -
saveEdit()
F.Grid.cellEditing.js, line 108 -
保存正在编辑的单元格
-
scrollToCell(row, columnId)
F.Grid.js, line 654 -
滚动到单元格
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 columnIdstring 列标识符 -
scrollToRow(row)
F.Grid.js, line 646 -
滚动到行
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 -
selectAllRows()
F.Grid.js, line 661 -
选中全部行
-
selectCell(row, columnId, options)
F.Grid.js, line 740 -
选中单元格
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 columnIdstring 列标识符 optionsObject 参数 Name Type Default Description scrollToboolean true 是否滚动到选中单元格 -
selectRow(row, options)
F.Grid.js, line 626 -
选中行
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 optionsObject 参数 Name Type Default Description keepboolean false 是否保持已选中行 keepUnselectableboolean true 是否保持不可选择行的选中状态(options.keep=true时,此参数无效) scrollToboolean true 是否滚动到选中行(仅有一行处于选中状态时有效) -
selectRows(rowIds, options)
F.Grid.js, line 638 -
选中多行
Name Type Description rowIdsArray.<number> | Array.<string> | Array.<jQuery> 行索引数组、行标识符数组或者行元素数组 optionsObject 参数 Name Type Default Description keepboolean false 是否保持已选中行 keepUnselectableboolean true 是否保持不可选择行的选中状态(options.keep=true时,此参数无效) scrollToboolean true 是否滚动到选中行(仅有一行处于选中状态时有效) -
inherited setAttr(key, value)
F.Component.js, line 94 -
设置节点属性
Name Type Description keystring 节点属性键 valuestring 节点属性值 -
inherited setAttrs(attrs)
F.Component.js, line 86 -
设置节点属性
Name Type Description attrsObject 节点属性对象 -
inherited setDisabled(disabled)
F.Component.js, line 248 -
设置控件的禁用状态
Name Type Description disabledboolean 是否禁用 -
setDisplayType(displayType)
F.Grid.js, line 1170 -
设置显示模式
Name Type Description displayTypestring 显示模式 -
inherited setEnabled(enabled)
F.Component.js, line 254 -
设置控件的启用状态
Name Type Description enabledboolean 是否启用 -
inherited setHeight(height)
F.Component.js, line 143 -
设置控件高度
Name Type Description heightnumber 高度 -
inherited setHidden(hidden)
F.Component.js, line 286 -
设置控件的隐藏状态
Name Type Description hiddenboolean 是否隐藏 -
setHiddenColumns(columns)
F.Grid.js, line 861 -
设置隐藏的列
Name Type Description columnsArray.<string> 隐藏的列标识符数组 -
inherited setIcon(icon)
F.PanelBase.js, line 152 -
设置图标地址
Name Type Description iconstring 图标地址 Example
F.ui.panel1.setIcon('../res/images/16/1.png'); -
inherited setIconFont(iconFont)
F.PanelBase.js, line 161 -
设置图标字体
Name Type Description iconFontstring 图标字体 Example
F.ui.panel1.setIconFont('bank'); -
inherited setIFrameUrl(url)
F.PanelBase.js, line 239 -
设置内联框架地址
Name Type Description urlstring 内联框架地址 -
setPageIndex(newPageIndex)
F.Grid.js, line 1041 -
设置新的分页索引
Name Type Description newPageIndexnumber 新的分页索引 -
setPageSize(newPageSize)
F.Grid.js, line 1055 -
设置每页记录数
Name Type Description newPageSizenumber 每页记录数 -
setRecordCount(newRecordCount)
F.Grid.js, line 1048 -
设置总记录数
Name Type Description newRecordCountnumber 总记录数 -
inherited setSize(width, height)
F.Component.js, line 158 -
设置控件尺寸
Name Type Description widthnumber 宽度 heightnumber 高度 -
setSortField(field, direction)
F.Grid.js, line 402 -
设置表格的排序状态
Name Type Description fieldstring | Array.<string> 排序字段(或者排序字段列表,仅适用于多列排序) directionstring optional 排序方向(可选项为:ASC, DESC) -
inherited setSplitDraggable(){boolean}
F.PanelBase.js, line 281 -
设置分隔条是否可以拖动
Returns:
Type Description boolean 是否可以拖动 -
setSummaryData(summaryRowIndex, summaryData)
F.Grid.loadData.js, line 63 -
设置合计行数据
Name Type Description summaryRowIndexnumber optional 合计行索引 summaryDataobject 合计行数据 -
inherited setTitle(title)
F.PanelBase.js, line 212 -
设置面板标题
Name Type Description titlestring 标题文本 -
inherited setTitleTooltip(tooltip)
F.PanelBase.js, line 232 -
设置面板标题提示信息
Name Type Description tooltipstring 提示信息字符串 -
inherited setTooltip(tooltip)
F.Component.js, line 202 -
设置提示信息
Name Type Description tooltipstring 提示信息 -
inherited setVisible(visible)
F.Component.js, line 280 -
设置控件的显示状态
Name Type Description visibleboolean 是否可见 -
inherited setWidth(width)
F.Component.js, line 150 -
设置控件宽度
Name Type Description widthnumber 宽度 -
inherited show()
F.Component.js, line 268 -
显示控件
-
showColumn(columnId)
F.Grid.js, line 880 -
显示列
Name Type Description columnIdstring 列标识符 -
inherited showLoading(opacity, container)
F.Container.js, line 103 -
显示加载动画
Name Type Description opacitynumber 透明度(默认值:0.65) containerjQuery 显示动画的目标元素(留空则为内容元素) -
startEdit(row, columnId)
F.Grid.cellEditing.js, line 102 -
开始编辑单元格
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 columnIdstring 列标识符 -
inherited toggleCollapse()
F.PanelBase.js, line 206 -
切换面板的折叠状态
-
inherited toggleEnabled()
F.Component.js, line 230 -
切换启用状态
-
toggleRowExpanders(rows)
F.Grid.js, line 796 -
切换行扩展列的展开状态
Name Type Description rowsjQuery 行元素 -
inherited toggleVisible()
F.Component.js, line 274 -
切换显示状态
-
inherited trigger(eventName, args)
F.Component.js, line 189 -
触发事件
Name Type Description eventNamestring 事件名称 argsObject 事件参数 -
unlockColumn(columnId)
F.Grid.js, line 846 -
解锁列
Name Type Description columnIdstring 列标识符 -
updateCellValue(row, columnId, value, forceUpdate)
F.Grid.cellEditing.js, line 93 -
更新单元格的值
Name Type Description rownumber | string | jQuery 行索引、行标识符或者行元素 columnIdstring | Object 列标识符或者简单对象 valueObject optional 单元格的值 forceUpdateboolean 是否强制更新(强制更新不显示左上角的已更改红色标识) Examples
更新单元格的值
F.ui.grid1.updateCellValue(1, 'Name', '张三');更新多个单元格的值
F.ui.grid1.updateCellValue(1, { 'Name': '张三', 'Gender': 1, 'EntranceYear': 2018 });更新单元格的属性(本示例禁用单元格)
F.ui.grid1.updateCellValue(1, 'Name.cls', 'f-grid-cell-uneditable');更新多个单元格的属性(本示例禁用单元格)
F.ui.grid1.updateCellValue(1, { 'Name.cls': 'f-grid-cell-uneditable', 'Gender.cls': 'f-grid-cell-uneditable' }); -
updateSummaryCellValue(rowIndex, columnId, value, forceUpdate)
F.Grid.js, line 1015 -
更新合计行单元格的值
Name Type Default Description rowIndexnumber 0 optional 合计行索引(默认为0) columnIdstring 列标识符 valueObject 合计行单元格的值 forceUpdateboolean 是否强制更新(强制更新不显示左上角的已更改红色标识)
Events
-
afteredit
F.Grid.cellEditing.js, line 39 -
单元格编辑完成时触发
Name Type Description eventjQuery.Event 事件对象 value* 单元格的值 paramsObject 事件参数 Name Type Description rowValueObject 行数据(键值对,键的列标识符) rowIndexnumber 行索引 rowIdstring 行标识符 rowDataObject 行数据 columnIndexnumber 列索引 columnIdstring 列标识符 columnObject 列对象 tdjQuery 单元格 trjQuery 行 -
beforeedit
F.Grid.cellEditing.js, line 20 -
单元格进入编辑状态之前触发(返回false则取消编辑操作)
Name Type Description eventjQuery.Event 事件对象 value* 单元格的值 paramsObject 事件参数 Name Type Description rowValueObject 行数据(键值对,键的列标识符) rowIndexnumber 行索引 rowIdstring 行标识符 rowDataObject 行数据 columnIndexnumber 列索引 columnIdstring 列标识符 columnObject 列对象 tdjQuery 单元格 trjQuery 行 -
beforefilterchange
F.Grid.headerMenuFilter.js, line 5 -
操作之前触发(返回false则取消过滤操作)
Name Type Description eventjQuery.Event 事件对象 columnIdstring 操作的列标识符 actionTypestring 操作类型(reset,ok,cancel) -
inherited beforehide
F.Component.js, line 57 -
隐藏控件之前触发(返回false则取消隐藏操作)
-
beforepaging
F.Grid.js, line 376 -
分页之前触发(返回false则取消分页操作)
Name Type Description eventjQuery.Event 事件对象 pageIndexnumber 新页面的索引 oldPageIndexnumber 老页面的索引 -
beforerowcontextmenu
F.Grid.js, line 217 -
右键点击行时触发(返回false则阻止浏览器默认的右键菜单)
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
inherited beforeshow
F.Component.js, line 69 -
显示控件之前触发(返回false则取消显示操作)
-
beforesorting
F.Grid.js, line 273 -
操作之前触发(返回false则取消排序操作)
Name Type Description eventjQuery.Event 事件对象 sortFieldstring 列字段名称 sortDirectionstring 排序方向(可选项为:ASC, DESC) columnIdstring 列标识符 -
beforetabedit
F.Grid.cellEditing.js, line 5 -
通过Tab键导航单元格之前触发(返回false则取消下一个单元格的编辑操作)
Name Type Description eventjQuery.Event 事件对象 paramsObject 事件参数 Name Type Description columnIndexnumber 列索引 columnIdstring 列标识符 columnObject 列对象 tdjQuery 单元格 trjQuery 行 nextTdjQuery 即将进入编辑状态的单元格 -
bigdatarowtip
F.Grid.js, line 229 -
大数据行数提示
Name Type Description eventjQuery.Event 事件对象 startRowNumbernumber 开始行数 endRowNumbernumber 结束行数 rowCountnumber 总行数 -
inherited collapse
F.PanelBase.js, line 68 -
折叠面板时触发
Name Type Description eventjQuery.Event 事件对象 -
columnhide
F.Grid.js, line 359 -
隐藏列时触发
Name Type Description eventjQuery.Event 事件对象 columnIdstring 列标识符 -
columnlock
F.Grid.js, line 343 -
锁定列时触发
Name Type Description eventjQuery.Event 事件对象 columnIdstring 列标识符 -
columnmove
F.Grid.loadData.js, line 10 -
移动列时触发(拖动操作)
Name Type Description eventjQuery.Event 事件对象 targetColumnIdstring 目标列标识符 sourceColumnIdstring 源列标识符 operationstring 操作类型(before:在目标列前面插入源列;after:在目标列后面插入源列) -
columnresize
F.Grid.loadData.js, line 20 -
改变列宽度时触发(拖动操作)
Name Type Description eventjQuery.Event 事件对象 columnIdstring 列标识符 newColumnWidthnumber 改变后列宽度 -
columnshow
F.Grid.js, line 368 -
显示列时触发
Name Type Description eventjQuery.Event 事件对象 columnIdstring 列标识符 -
columnunlock
F.Grid.js, line 351 -
解锁列时触发
Name Type Description eventjQuery.Event 事件对象 columnIdstring 列标识符 -
datachange
F.Grid.cellEditing.js, line 58 -
数据改变时触发
Name Type Description eventjQuery.Event 事件对象 -
dataload
F.Grid.loadData.js, line 4 -
表格数据加载完毕时触发
-
inherited dirtychange
F.PanelBase.js, line 45 -
容器内的字段值改变时触发
-
inherited expand
F.PanelBase.js, line 76 -
展开面板时触发
Name Type Description eventjQuery.Event 事件对象 -
filterchange
F.Grid.headerMenuFilter.js, line 16 -
表头过滤时触发
Name Type Description eventjQuery.Event 事件对象 filteredDataObject 过滤数据 columnIdstring 操作的列标识符 actionTypestring 操作类型(reset,ok,cancel) -
inherited hide
F.Component.js, line 63 -
隐藏控件时触发
-
inherited iframeload
F.PanelBase.js, line 84 -
内联框架加载完毕时触发
-
inherited layout
F.Component.js, line 45 -
布局控件时触发
-
paging
F.Grid.js, line 385 -
分页跳转时触发
Name Type Description eventjQuery.Event 事件对象 pageIndexnumber 新页面的索引 oldPageIndexnumber 老页面的索引 -
inherited render
F.Component.js, line 51 -
渲染控件时触发
-
inherited resize
F.PanelBase.js, line 61 -
面板尺寸改变时触发
-
rowclick
F.Grid.js, line 197 -
点击行时触发
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
rowcollapse
F.Grid.js, line 315 -
折叠行时触发
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
rowdblclick
F.Grid.js, line 207 -
双击行时触发
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
rowdeselect
F.Grid.js, line 254 -
取消选中行时触发
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
rowexpand
F.Grid.js, line 305 -
展开行时触发
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
rowexpandercollapse
F.Grid.js, line 334 -
折叠行扩展列时触发
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
rowexpanderexpand
F.Grid.js, line 324 -
展开行扩展列时触发
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
rowlazyload
F.Grid.js, line 295 -
延迟加载行数据时触发
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
rowselect
F.Grid.js, line 243 -
选中行时触发
Name Type Description eventjQuery.Event 事件对象 rowIdstring 行标识符 rowIndexnumber 行索引 -
selectionchange
F.Grid.js, line 264 -
选中的行改变时触发
Name Type Description eventjQuery.Event 事件对象 -
inherited show
F.Component.js, line 75 -
显示控件时触发
-
sorting
F.Grid.js, line 285 -
排序时触发
Name Type Description eventjQuery.Event 事件对象 sortFieldstring 列字段名称 sortDirectionstring 排序方向(可选项为:ASC, DESC) columnIdstring 列标识符 -
inherited splitdrag
F.PanelBase.js, line 53 -
拖动分隔条时触发(拖动操作)
Name Type Description eventjQuery.Event 事件对象