代码:

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. package-info.java

    参考文章: http://blog.sina.com.cn/s/blog_93dc666c0101gzlr.html 对于package-info.java我们并不陌生,但又陌生. 在我们每次建立pa ...

  2. elasticSearch-DSL

    DSL: query_string match match_phrase match_phrase_prefix multi_match   simple_query_string term term ...

  3. 笨方法学python之转义字符

    ASCII码值(十进制) \a 响铃(BEL) 007 //响铃(有声音) \b 退格(BS) 008 //使当前的输出位置退一格,即输出的起始位置左移一位 */ \f 换页(FF) 012 //只有 ...

  4. jwt-auth错误小结

    我用的是:"tymon/jwt-auth": "1.0.0-rc.1" 根据官方网站http://jwt-auth.readthedocs.io安装,并且ven ...

  5. C#new出来的结构体内存分配在堆上

    如题,有同事说因为结构体是值类型,所以 new出来的也是分配在栈上的.我的直觉是但凡使用new的东西都在堆上分配内存,除非C#对结构体做了特殊处理. new int[10]这个说明不了什么,因为数组是 ...

  6. Nginx性能优化

    一.编译安装过程优化 1.减小Nginx编译后的文件大小 在编译Nginx时,默认以debug模式进行,而在debug模式下会插入很多跟踪和ASSERT之类的信息,编译完成后,一个Nginx要有好几兆 ...

  7. ReactiveX 学习笔记(16)RxPY

    RxPY RxPY 是 ReactiveX 的 Python语言实现. # 安装 RxPY $ pip3 install rx Successfully installed rx-1.6.1 Basi ...

  8. SSL和TLS协议的区别

    SSL:(Secure Socket Layer,安全套接字层),位于可靠的面向连接的网络层协议和应用层协议之间的一种协议层.SSL通过互相认证.使用数字签名确保完整性.使用加密确保私密性,以实现客户 ...

  9. Logo tools

    http://www.cilogo.com/LOGO/

  10. Java复习 之多线程

    线程是一个程序中的不同路径 例子1 只有一条路径 每一个分支都是一个线程 实际上在一个时刻内 电脑只能运行一个进程 但是因为cpu运算速度很快 将时间分出来了 所以我们感觉是同时运行 创建线程的两种方 ...