代码:

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. Redis脚本

    8.启动 /usr/local/bin/redis-server /etc/redis/redis.conf ./redis-server /home/work/redis/redis.conf &a ...

  2. native.js 判断是否安装某app

    例:是否安装微信 function isWeixin() { var UIApplication = plus.ios.importClass("UIApplication"); ...

  3. vue:图片切换动态显示

    <img :src="切换条件 ? require('xxx.png') : require('xxx.png')" />

  4. SIGCHLD信号

    SIGCHLD的产生条件 子进程终止时 子进程接收到SIGSTOP信号停止时 子进程处在停止态,接受到SIGCONT后唤醒时 也就是说:子进程的运行状态发生变化就会发送SIGCHILD信号:这里的意思 ...

  5. bug提单规范

    一.提单模板 标题:[项目组][模块][子模块][发生原因]问题简要描述描述:[预置条件] 有就写清楚,没有就写无[操作步骤]1.XXXXX2.XXXXXX3.XXXXX[实际结果] XXXXX[预期 ...

  6. vue项目bug-Couldn’t find preset "es2015"

    在使用vue项目的时候安装了其他的插件,发现会报错 Couldn’t find preset "es2015".是因引用的插件使用了es标准,解决办法如下 npm install ...

  7. 四则运算3+PSP

    题目要求: 1.要求在第二次实验(四则运算2)的基础上加上其他功能. 2.要求能够在每个运算式打印出来后,用户能够进行输入计算的答案,并且程序进行判断给出用户输入的答案的正确性. 3.要求实现四则混合 ...

  8. C# winform进度条 (异步)

    进度条页面: http://www.cnblogs.com/Deckard/archive/2009/06/24/1510451.html //============================ ...

  9. [PHP]自定义session存储机制的两种方案

    ---------------------------------------------------------------------------------------------------- ...

  10. Webservice之axis

    根据wsdl的url,使用axis1.4生成客户端,并且对webservice进行调用   1.到www.apache.org上去下载axis-bin-1_4.zip,如要关联源代码就把axis-sr ...