博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
easyui datagrid 三层嵌套
阅读量:4468 次
发布时间:2019-06-08

本文共 6623 字,大约阅读时间需要 22 分钟。

代码:

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 '
'; }, 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 '
'; }, 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); } }); } }); } });}

 

转载于:https://www.cnblogs.com/raitorei/p/10038249.html

你可能感兴趣的文章
JavaScript--函数对象的属性caller与callee
查看>>
特殊字符大全
查看>>
SQL - SQL 连接 JOIN 例解。(左连接,右连接,全连接,内连接,交叉连接,自连接)[转]...
查看>>
《learning hard C#学习笔记》读书笔记(20)异步编程
查看>>
动态创建Struct实例
查看>>
Jsp通过JDBC连接到SQL Server2008数据库遇到的几个问题
查看>>
idea 不能编译生成class文件
查看>>
javascript原生百叶窗
查看>>
单播组播和广播
查看>>
JSPatch - iOS 动态补丁
查看>>
eclipse设置和优化
查看>>
WinFrom玩转config配置文件
查看>>
IIS服务中五种身份验证
查看>>
c#网络编程-第一章
查看>>
paip.提升效率--僵尸代码的迷思
查看>>
Atitit 自动化gui 与 发帖机 技术
查看>>
Atitit.研发团队与公司绩效管理的原理概论的attilax总结
查看>>
编程模式之装饰模式(Decorator)
查看>>
MVC中关于 使用后台代码 检查 用户名是否已经被清册
查看>>
匿名函数
查看>>