代码:

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. APP-10-文字识别-票据识别

    1.Postman测试 2.参数 https://cloud.baidu.com/doc/OCR/OCR-API.html#.E9.80.9A.E7.94.A8.E7.A5.A8.E6.8D.AE.E ...

  2. LeetCode题解:Flatten Binary Tree to Linked List:别人的递归!

    总是在看完别人的代码之后,才发现自己的差距! 我的递归: 先把左侧扁平化,再把右侧扁平化. 然后找到左侧最后一个节点,把右侧移动过去. 然后把左侧整体移到右侧,左侧置为空. 很复杂吧! 如果节点很长的 ...

  3. Delphi TMemoryStream写入到字符串和字符串写入到流

    一.TMemoryStream数据写入到字符串里 var lvStream:TMemoryStream; s:AnsiString; p: PAnsiChar; begin lvStream:= TM ...

  4. git 常用的命令总结

    下载gitlab上的代码: git clone ssh://git@47.xx.xx.xx:4xx/xxx.git 查看git代码状态: git status 不提交的代码文件: git checko ...

  5. VS Code 使用笔记

    改变 UI 语言 How to change UI language in Visual Studio Code? 设置 Tab 空格 How to set tab-space style?

  6. sass实战演练01 - 外部文件引用和变量

    SASS是什么? 目前前端开发中css已经是公认的”前端程序员必须掌握”的知识,最早的css编写都是手工一条条写出来的,工作量大.不利于维护. 而sass的存在使得css开发可以像写代码一样最终生成一 ...

  7. avalon2学习教程01

    经过难苦奋战,avalon2终于面世了.这花了大半年时间,其中1.6还胎死腹中.长达半年没有产出,我都担心自己会被裁掉…… avalon2许多API与1.4.×保持一致,当然也添加了一些1.5的功能, ...

  8. [Linux]CentOS7搭建Nginx + MySQL + PHP

    ------------------------------------------------------------------------------------- Nginx安装参考地址:ht ...

  9. hdu2973-YAPTCHA-(欧拉筛+威尔逊定理+前缀和)

    YAPTCHA Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  10. 如何使用CBO,CBO与RULE的区别

    Oracle的优化器有两种优化方式,即基于规则的优化方式(Rule-Based Optimization,简称为RBO)和基于代价的优化方式(Cost-Based Optimization,简称为CB ...