DataGrid 표시 내역 데이터

2157 단어 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 밑에 패널도 돼요.
     2.기본적으로 도입해야 하는 js를 제외하고 데이터grid-detailview도 도입해야 한다.js
     3.$('#ddv-'+index)는 대응하는
의 id

좋은 웹페이지 즐겨찾기