DataGrid 显示明细数据
view: detailview,//注意1
detailFormatter:function(index,row){//注意2
return '<div style="padding:2px"><table id="ddv-' + index + '"></table></div>';
},
onExpandRow: function(index,row){ //注意3
$('#ddv-'+index).datagrid({
url:getContextPath()+'/dispatch/dispatch_queryByDispatchId.action?data='+row.id,
fitColumns:true,
singleSelect:true,
rownumbers:true,
loadMsg:'',
height:'auto',
columns:[[
{title : 'ID',field : 'id',hidden:true},
{title:'订单号',field:'orderNo'},
{title : '订单状态',field :'orderState',formatter:formatOrderState},
{title : '车数',field : 'carNum'},
{title : '下单时间',field : 'orderTime'},
{title : '始发站',field : 'originStop'},
{title : '目的站',field : 'destination'},
{title : '要求发车时间',field : 'requreDepatrueTime'},
{title : '下单网点',field : 'orderDepartment',formatter:formatOrderDepartment},
{title : '创建人',field : 'createUser'},
{title : '创建时间',field : 'createTime'},
{title : '修改人',field : 'updateUser'},
{title : '最后修改时间',field : 'updateTime'}
]],
onResize:function(){ //注意点4 设置onResize onLoadSuccess 是为了调整展开页面的布局
$('#dispatchGrid').datagrid('fixDetailRowHeight',index);
},
onLoadSuccess:function(){
setTimeout(function(){
$('#dispatchGrid').datagrid('fixDetailRowHeight',index);
},0);
}
});
}
});注:1.onExpandRow 下面也可以是panel
2.除了基本要引入的js,还需要引入datagrid-detailview.js
3.$('#ddv-'+index) 是对应的<table id="ddv-' + index + '"></table>的id
相关推荐
89427412 2020-02-13
morexyoung 2019-12-20
EdwardSiCong 2015-04-11
ningwentao 2015-10-21
zderam的私人 2019-09-02
shanhuijava 2016-08-17
wndong 2016-03-04
AngelicaA 2015-12-22
xiaobozhu 2015-10-27
yypiao 2015-10-21
小策一喋 2015-09-17
小仙儿 2015-06-15
huzai 2015-06-03
huzai 2015-04-22
zhangmingming 2015-03-11
葉無聞 2015-01-01
sunnylinner 2014-12-19
pplxh 2014-10-21