Extension > DataGrid View
扩展下载地址:http://www.jeasyui.com/extension/downloads/jquery-easyui-datagridview.zip (我发布的程序包整也有提供,在extension目录下)
| 属性名 | 属性值类型 | 描述 | 默认值 |
|---|---|---|---|
| detailFormatter | function(index,row) | detailFormatter函数返回行详细内容。 |
| 事件名 | 参数 | 描述 |
|---|---|---|
| onExpandRow | index,row | 在展开行的时候触发。 |
| onCollapseRow | index,row | 在折叠行的时候触发。 |
| 方法名 | 参数 | 描述 |
|---|---|---|
| fixDetailRowHeight | index | 修复明细行高度。 |
| getExpander | index | 获取行展开对象。 |
| getRowDetail | index | 获取明细内容。 |
| expandRow | index | 展开一行。 |
| collapseRow | index | 折叠一行。 |
| subgrid | conf |
创建一个嵌套的子表格。“conf”参数有“option”和“subgrid”属性: 代码示例: var conf = {
options:{
//主表格参数
},
subgrid:{
options:{
foreignField:'orderid', // 外键关联字段
// 其他表格参数
},
subgrid:{
options:{
foreignField:...,
// 其他表格参数
}
}
}
};
$('#dg').datagrid().datagrid('subgrid', conf); |
| getParentGrid | none | 获取父datagrid对象。 |
| getParentRowIndex | none | 获取父行索引。 |
| 属性名 | 属性值类型 | 描述 | 默认值 |
|---|---|---|---|
| groupField | string | 声明哪些字段分组。 | |
| groupFormatter | function(value,rows) | groupFormatter函数返回分组内容。value参数指明了分组值定义的'groupField'属性。rows参数指明了指定分组值的数据行。 | |
| groupStyler | function(value,rows) | 函数返回CSS样式组。 value参数表名了通过'groupField'属性定义的分组值。 rows参数表明了根据分组值指定的数据行。 代码示例: $('#dg').datagrid({
groupStyler: function(value,rows){
if (value == 'RP-LI-02'){
return 'background-color:#6293BB;color:#fff;'; // return inline style
// the function can return predefined css class and inline style
// return {class:'r1', style:{'color:#fff'}};
}
}
});
|
| 方法名 | 参数 | 描述 |
|---|---|---|
| expandGroup | groupIndex | 展开一个分组。 |
| collapseGroup | groupIndex | 折叠一个分组。 |
| scrollToGroup | groupIndex | 滚动一个分组。 |
| 方法名 | 参数 | 描述 |
|---|---|---|
| gotoPage | page | 跳转到指定页面。 |
| scrollTo | index | 滚动视图到指定的行。 |
| fixDetailRowHeight | index | 固定明细行行高。 |
| getExpander | index | 获取展开对象。 |
| getRowDetail | index | 获取明细内容。 |
| expandRow | index | 展开一行。 |
| collapseRow | index | 折叠一行。 |