easyui datagrid-detailview 嵌套高度自适应
实现效果
原因
异步加载,明细展开时,可能会遇到父列表不能自动适应子列表高度的变化
具体代码
$('#centerdatagrid').datagrid({
url:'${ctx}/offer/offer!projectPage.htm',
title: '项目列表',
iconCls:'iconfont icon-iconlist',
toolbar: '#toolbar',
border: false,
fit: true,
singleSelect: true,
striped : true,
toolbar: '#toolbar',
pagination: true,
pageSize: 20,
rownumbers: true,
fitColumns: false,
autoRowHeight:true,
columns: [
[
{field: 'name', title: '项目名称'},
{field: 'projectTreeName', title: '项目分类'},
{field: 'customer', title: '客户'},
{field: 'salesperson', title: '销售员'},
{field: 'bidder', title: '报价人'},
{field: 'offerTime', title: '时间'},
{field: 'description', title: '备注'},
{field: 'operate', title: '操作',
formatter: function(value,row,index){
var html = '<a onclick="toList('+row.projectId+')" href="javascript:void(0);">【添加子项目】</a>';
html = html + '<a onclick="toList('+row.projectId+')" href="javascript:void(0);">【查看报价清单】</a>';
return html;
}
}
]
],
onBeforeLoad:function(){},
onLoadSuccess:function(){},
view: detailview,
detailFormatter:function(index,row){
return '<div style="padding:2px"><table class="ddv"></table></div>';
},
onExpandRow: function(index,row){
var ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
ddv.datagrid({
url:'${ctx}/offer/offer!projectPage.htm',
fitColumns:true,
singleSelect:true,
loadMsg:'',
//height:'auto',
autoRowHeight:true,
pagination: true,
pageSize: 20,
columns: [
[
{field: 'name', title: '项目名称'},
{field: 'projectTreeName', title: '项目分类'},
{field: 'customer', title: '客户'},
{field: 'salesperson', title: '销售员'},
{field: 'bidder', title: '报价人'},
{field: 'offerTime', title: '时间'},
{field: 'description', title: '备注'}
]
],
onResize:function(){
$('#centerdatagrid').datagrid('fixDetailRowHeight',index);
},
onLoadSuccess:function(){
setTimeout(function(){
$('#centerdatagrid').datagrid('fixDetailRowHeight',index);//在加载爷爷列表明细(即:父列表)成功时,获取此时整个列表的高度,使其适应变化后的高度,此时的索引
$('#centerdatagrid').datagrid('fixRowHeight',index);//防止出现滑动条
},0);
}
});
$('#centerdatagrid').datagrid('fixDetailRowHeight',index);
}
});
easyui datagrid-detailview 嵌套高度自适应的更多相关文章
- easyui datagrid detailview嵌套datagrid的问题
解决问题办法来自 http://www.coding123.net/article/20141113/easyui-datagrid-datailview-use-sub-datagrid-not-a ...
- WPF设置DataGrid行内容高度自适应 与 TextBox/TextBlock内容高度自适应
WPF设置DataGrid行内容高度自适应 TextBox/TextBlock内容高度自适应 参考: DataGrid 控件中的调整大小选项: http://msdn.microsoft.com/ ...
- easyui datagrid标题列宽度自适应
最近项目中使用easyui做前端界面,相信大部分使用过easyui datagrid的朋友有这么一个疑问:如果在columns中不设置width属性能不能写个方法让datagrid的头部标题和数据主体 ...
- easyui设置界面的高度自适应
单独设置界面中特定region区时,高度自适应失败:设置整个界面时成功.实现代码在script块中,具体代码如下: <%@ Page Language="C#" AutoEv ...
- easyui datagrid 三层嵌套
代码: function local(role,region,ip){ $("#roleList").datagrid({ // title:'服务器监控列表', height:( ...
- jquery easyui datagrid detailview groupview添加自定义视图view
var myview = $.extend({}, $.fn.datagrid.defaults.view, { onAfterRender: function (target) { $.fn.dat ...
- jquery easyui datagrid 空白条处理 自适应宽高 格式化函数formmater 初始化时会报错 cannot read property 'width'||'length' of null|undefined
1---表格定义好之后右侧可能会有一个空白条 这个空白条是留给滚动条的,当表格中的一页的数据在页面中不能全显示时会自动出现滚动条,网上有很多事要改源码才可以修改这个,但是当项目中多处用到时,有的需要滚 ...
- EasyUI combobox 下拉高度自适应
要指出的是,combobox是继承自combo的,所以,combo的属性也可以被combobox使用,该问题也是这样产生的,知道这个原理,该问题就解决一半了,另一点要指出的是,在easyui中,num ...
- 如何使easyui的datagrid 高度自适应
如何使easyui的datagrid 高度自适应? 最开始使用easyui的datagrid加载数据时,对其设置的高度都是固定值,数据较多时table表现为滚动条形式.某天,老大突然需要datagri ...
随机推荐
- Jauery 中Ajax的几种异步请求
以下介绍Jquery中 Post Get Ajax几种异步请求的使用方法 <%@ Page Language="C#" AutoEventWireup=&q ...
- install nginx error
the error info : the HTTP gzip module requires the zlib library.You can either disable the module by ...
- js 日期时间大小比较
<body> 开始时间:<input onfocus="setday(this)" id="startTime" name="sta ...
- (转)淘淘商城系列——使用maven tomcat插件启动web工程
http://blog.csdn.net/yerenyuan_pku/article/details/72672138 上文我们一起学习了怎样搭建maven工程,这篇文章我就来教大家一起学习怎样用to ...
- 【原创】DESTOON做中英双语言(多语言)切换版本具体详解
第一次发原创好激动,该注意点什么? 在开发过程中用户有许多要求,比如这个多语言切换就是一个需求. 首先讲解一下DESTOON(DT)后台系统如何做这个中英.甚至多语言切换的这个功能. DT本身不自带多 ...
- selenium兼容非标准chrome内核的浏览器
多浏览器兼容性测试(1) RIDE已经支持多浏览器兼容性测试,例如: firefox ie chrome safari 但是,项目要求支持360极速和360安全浏览器.所以,我们需要增加代码让RIDE ...
- Flask框架 之模版
一.过滤器 safe:禁用转义: <p>{{ '<em>hello</em>' | safe }}</p> capitalize:把变量值的首字母转成大 ...
- 谷歌全屏脚本 start chrome.exe --kiosk http://www.baidu.com
start chrome.exe --kiosk http://www.baidu.com
- 正则表达式,匹配查找函数(preg_match_all)flags参数对比
格式: int preg_match_all ( string pattern, string subject, array matches [, int flags] ) 参数 flags 选项有以 ...
- BZOJ 1565 植物大战僵尸 最大权闭合子图+网络流
题意: 植物大战僵尸,一个n*m的格子,每 个格子里有一个植物,每个植物有两个属性: (1)价值: (2)保护集合,也就是这个植物可以保护矩阵中的某些格子. 现在你是僵尸,你每次只能从(i,m) 格子 ...