------------------------------原代码-----------------------------------------------------------------------
$('#datagrid').datagrid({
singleSelect: true,
url:'/XX/XXXX',
queryParams: {searchInfo: Postdata },
title: '',
rownumbers: true,
pagination: true,
checkOnSelect: false,
selectOnCheck: false,
fitColumns:true,
columns: [[
{ field: 'guid', checkbox: true},
{ field: 'name1', title: 'xxxxxxx', width: '10%' },
{ field: 'name2', title: 'xxxxxxxxx', width: '20%' },
{ field: 'cycle', title: 'xxxxxxxx', width: '10%' },
{ field: 'name3', title: 'xxxxxxxx', width: '10%' },
{ field: 'setperson', title: 'xxxxx', width: '10%' },
{ field: 'name', title: 'xxxx', width: '10%' },
]],
onLoadSuccess:function(date){
},
view: detailview,
detailFormatter:function(index,row){
return '
';},
onExpandRow: function(index,row){
childerndatagrid(row.id,row.guid);
},
toolbar: '#tb'
});
function childerndatagrid(index,guid){
$("#"+guid).datagrid({
singleSelect: true,
url:'/DynaTable/getPagesJson',
queryParams: { searchInfo: Postdata },
title: '',
rownumbers: true,
pagination: true,
checkOnSelect: false,
selectOnCheck: true,
pageSize:5,
pageList:[5],
columns: [[
{ field: 'name', title: 'aaa', width: '200px' },
{ field: 'starttime', title: 'ass', width: '200px' },
{ field: 'endtime', title: 'ded', width: '200px' },
]],
onResize:function(){
$('#datagrid').datagrid('fixDetailRowHeight',index);
},
onLoadSuccess:function(){
setTimeout(function(){
$('#datagrid').datagrid('fixDetailRowHeight',index);
$.parser.parse($('#'+guid));
},100);
}
});
$('#datagrid').datagrid('fixDetailRowHeight',index);
}
//------------------------------------------------------分隔线--------------------------------------------------------
$('#datagrid').datagrid({
singleSelect: true,
url:'/XX/XXXX',
queryParams: {searchInfo: Postdata },
title: '',
rownumbers: true,
pagination: true,
checkOnSelect: false,
selectOnCheck: false,
fitColumns:true,
columns: [[
{ field: 'guid', checkbox: true},
{ field: 'name1', title: 'xxxxxxx', width: '10%' },
{ field: 'name2', title: 'xxxxxxxxx', width: '20%' },
{ field: 'cycle', title: 'xxxxxxxx', width: '10%' },
{ field: 'name3', title: 'xxxxxxxx', width: '10%' },
{ field: 'setperson', title: 'xxxxx', width: '10%' },
{ field: 'name', title: 'xxxx', width: '10%' },
]],
onLoadSuccess:function(date){
},
view: detailview,
detailFormatter:function(index,row){
//key 用来处理二级列表的表头和内容错乱的问题
return '
';},
onExpandRow: function(index,row){
childerndatagrid(row.id,row.guid);
},
toolbar: '#tb'
});
function childerndatagrid(index,guid){
$("#key"+guid).datagrid({
singleSelect: true,
url:'/DynaTable/getPagesJson',
queryParams: { searchInfo: Postdata },
title: '',
rownumbers: true,
pagination: true,
checkOnSelect: false,
selectOnCheck: true,
pageSize:5,
pageList:[5],
columns: [[
{ field: 'name', title: 'aaa', width: '200px' },
{ field: 'starttime', title: 'ass', width: '200px' },
{ field: 'endtime', title: 'ded', width: '200px' },
]],
onResize:function(){
$('#datagrid').datagrid('fixDetailRowHeight',index);
},
onLoadSuccess:function(){
setTimeout(function(){
$('#datagrid').datagrid('fixDetailRowHeight',index);
$.parser.parse($('#'+guid));
},100);
}
});
$('#datagrid').datagrid('fixDetailRowHeight',index);
}