代码:

function local(role,region,ip){
$("#roleList").datagrid({
// title:'服务器监控列表',
height:($(window).height())-35,
iconCls : 'icon-ok',
width:"100%",
pageSize : 15,//默认选择的分页是每页5行数据
pageList : [ 15,50,100,150 ],//可以选择的分页集合
nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
striped : true,//设置为true将交替显示行背景。
collapsible : true,//显示可折叠按钮
toolbar:"#tb",//在添加 增添、删除、修改操作的按钮要用到这个
url:'config/getRoleList.action',//url调用Action方法
loadMsg : '数据装载中......',
singleSelect:true,//为true时只能选择单行
fitColumns:true,//允许表格自动缩放,以适应父容器
//sortName : 'xh',//当数据表格初始化时以哪一列来排序
//sortOrder : 'desc',//定义排序顺序,可以是'asc'或者'desc'(正序或者倒序)。
remoteSort : false,
pagination : true,//分页
rownumbers : true,//行数
queryParams:{'role_id':role,'region':region,'ip':ip},
onLoad:function(index,row){
$('#roleList').datagrid('fixDetailRowHeight',index);
$('#roleList').datagrid('selectRow',index);
$('#roleList').datagrid('getRowDetail',index).find('form').form('load',row);
$('#roleList').datagrid('fixDetailRowHeight',index);
$('#roleList').datagrid('fixRowHeight', index);
},
onLoadSuccess:function(index,row){
setTimeout(function(){
$('#roleList').datagrid('fixRowHeight',index);
$('#roleList').datagrid('fixDetailRowHeight',index);
},0)
},
onResize:function(index,row){//严重注意喔
$('#roleList').datagrid('fixDetailRowHeight',index);
},
rowStyler:function(index,row){ },
view: detailview,
detailFormatter:function(index,row){//严重注意喔
return '<div"><table id="ddv-' + index + '" ></table></div>';
},
onExpandRow: function(index,row){//嵌套第一层,严重注意喔
var ddv = $(this).datagrid('getRowDetail',index).find('#ddv-'+index);//严重注意喔
ddv.datagrid({
// view: detailview,
url:'report/getAlarmSystem.action',
autoRowHeight:true,
fitColumns:true,//改变横向滚动条
singleSelect:false,//去掉选中效果
rownumbers:true,
loadMsg:'',
queryParams:{'role_id':row.id,'region':region,'ip':ip},
height:'auto',
columns:[[
{field:'XXX',title:'XXX',width:70,align:'center',},
{field:'XXX',title:'XXX',width:70,align:'center',},
{field:'XXX',title:'XXX',width:50,align:'center',},
]],
onLoad:function(){
$('#roleList').datagrid('fixDetailRowHeight',index);
$('#roleList').datagrid('selectRow',index);
$('#roleList').datagrid('getRowDetail',index).find('form').form('load',row);
$('#roleList').datagrid('fixDetailRowHeight',index);
$('#roleList').datagrid('fixRowHeight', index);
},
onResize:function(){
$('#roleList').datagrid('fixDetailRowHeight',index);
},
rowStyler:function(index1,row1){
if (row1.mstatus=='2'){
return 'background-color:#FF6347;';
}else if(row1.mstatus=='1'){
return 'background-color:#FFF68F;';//黄色
}else if(row1.mstatus=='0'){
return 'background-color:#98FB98;';
}
},
onLoadSuccess:function(){
setTimeout(function(){
$('#roleList').datagrid('fixDetailRowHeight',index);
$('#roleList').datagrid('fixRowHeight',index);//防止出现滑动条
},0);
},
view: detailview,
detailFormatter:function(index,row){//严重注意喔
return '<div"><table id="ddvv-' + index + '" ></table></div>';
},
onExpandRow: function(index,row){//嵌套第一层,严重注意喔
var ddvv = $(this).datagrid('getRowDetail',index).find('#ddvv-'+index);//严重注意喔
ddvv.datagrid({
// view: detailview,
url:'report/getSystemMonitor.action',
autoRowHeight:true,
fitColumns:true,//改变横向滚动条
singleSelect:false,//去掉选中效果
rownumbers:true,
loadMsg:'',
queryParams:{'ip':row.ip},
height:'auto',
columns:[[
   {field:'XXX',title:'XXX',width:80,align:'center',},
{field:'XXX',title:'XXX',width:100,align:'center',},
{field:'XXX',title:'XXX',width:200,align:'center',},
{field:'XXX',title:'XXX',width:50,formatter:setAlarm,align:'center',},
{field:'XXX',title:'XXX',width:150,align:'center',},
{field:'XXX',title:'XXX',width:100,align:'center',}
]],
onLoad:function(){
$('#roleList').datagrid('fixDetailRowHeight',index);
$('#roleList').datagrid('selectRow',index);
$('#roleList').datagrid('getRowDetail',index).find('form').form('load',row);
$('#roleList').datagrid('fixDetailRowHeight',index);
$('#roleList').datagrid('fixRowHeight', index);
},
onResize:function(){
$('#roleList').datagrid('fixDetailRowHeight',index);
},
rowStyler:function(index1,row1){
if (row1.alarm_level=='2'){
return 'background-color:#FF6347;';
}else if(row1.alarm_level=='1'){
return 'background-color:#FFF68F;';//黄色
}else if(row1.alarm_level=='0'){
return 'background-color:#98FB98;';
}
},
onLoadSuccess:function(){
setTimeout(function(){
$('#roleList').datagrid('fixDetailRowHeight',index);
$('#roleList').datagrid('fixRowHeight',index);//防止出现滑动条
},0);
}
});
}
});
}
});
}

easyui datagrid 三层嵌套的更多相关文章

  1. easyui datagrid detailview嵌套datagrid的问题

    解决问题办法来自 http://www.coding123.net/article/20141113/easyui-datagrid-datailview-use-sub-datagrid-not-a ...

  2. easyui datagrid属性和方法

    本文可以当做api来使用 使用方法(Usage Example) 从现有的表单元素创建数据表格,定义在html中的行,列和数据. <table class="easyui-datagr ...

  3. 数据网格和树-EasyUI Datagrid 数据网格、EasyUI Propertygrid 属性网格、EasyUI Tree 树、EasyUI Treegrid 树形网格

    EasyUI Datagrid 数据网格 扩展自 $.fn.panel.defaults.通过 $.fn.datagrid.defaults 重写默认的 defaults. 数据网格(datagrid ...

  4. easyui datagrid的API

    本文可以当做api来使用 动态编辑用到DOM解析的话参考 http://www.w3school.com.cn/xmldom/dom_htmlcollection.asp 使用方法(Usage Exa ...

  5. JQuery easyUI DataGrid 创建复杂列表头(译)

    » Create column groups in DataGrid The easyui DataGrid has ability to group columns, as the followin ...

  6. 构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(8)-MVC与EasyUI DataGrid 分页

    系列目录 前言 为了符合后面更新后的重构系统,文章于2016-11-1日重写 EasyUI Datagrid在加载的时候会提交一些分页的信息到后台,我们需要根据这些信息来进行数据分页再次返回到前台 实 ...

  7. 控制EasyUI DataGrid高度

    这次要说的是控制EasyUI的高度,平时我公司的项目,用EasyUI较多,然后datagrid这个组件是用的非常多的.平时我们都是固定高度,常见代码如下:             <table  ...

  8. EasyUI datagrid 日期时间格式化

    EasyUI datagrid中显示日期时间时,会显示为以下不太直观的数值: 添加以下JavaScript脚本,然后在field中添加 formatter: DateTimeFormatter 即可. ...

  9. easyui datagrid中 多表头方法总结

    easyui datagrid中怎么设置表头成多行显示呢?其实很简单,就是给datagrid的columns属性设置成多个数组就行了.下面直接看例子吧,这是一个两行表头的,按照此方法,还可以设置三行表 ...

随机推荐

  1. python中pop()函数的用法

    pop() 函数用于移除列表中的一个元素(默认最后一个元素),并且返回该元素的值. 语法:list.pop(obj=list[-1]) //默认为 index=-1,删除最后一个列表值. obj -- ...

  2. tomcat7修改tomcat-users.xml文件,但服务器重启后又自动还原了。

    tomcat7配置用户管理权限,修改tomcat-users.xml文件 在%tomcat%目录中找到/conf/tomcat-users.xml,修改 <tomcat-users>    ...

  3. kafka config

    Config parameters that influence the log retention time. log.roll.hours  # how long to produce a new ...

  4. 1047B_Cover Points

    B. Cover Points time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  5. Pycharm 字体大小快捷方式设置

    1.File->Settings 2.在搜索框搜索increase 点击Increase Font Size(增大字体)右键选择 Add Mouse Shortcut 然后按Ctrl并且鼠标滚轮 ...

  6. UnityHub破解

    1.退出UnityHub,安装好nodejs执行以下命令 npm install -g asar 2.打开UnityHub安装目录如 C:\Program Files\Unity Hub\resour ...

  7. Oracle数据文件迁移到裸设备

    本文主要描述如何将Oracle表空间的文件系统形式的数据文件迁移到LV裸设备上. 前提条件 1.oracle运行正常. 2.已使用LVM命令规划好LV文件.如/dev/vgoracle/lvdatat ...

  8. mysql如何出查出最近7天,最近30天,最近n天的记录?

    已查询浏览量为例:原始数据如下: 思路分析:数据有了,统计某一天的浏览量,所有浏览量,或固定时间段内的浏览量在这里我们就不多说了,大家都会,那我们是如何将最近七天的数据统计出来呢? 首先,我们说的最近 ...

  9. svg-edit和svg中的自定义属性

    用svg的码农们肯定知道,在path.rect等元数据中会加入一些自定义属性,保存于数据库,但是用svg-edit编辑器时, 读取的时候,无法读取些这些自定义属性.解决办法:找sanitize.js文 ...

  10. Monkey测试结果分析【转】

    转自[http://www.douban.com/note/257030241/] Monkey测试结果分析 一. 初步分析方法: Monkey测试出现错误后,一般的差错步骤为以下几步: 1. 找到是 ...