The solution comes from http://www.coding123.net/article/20141113/easyui-datagrid-datailview-use-sub-datagrid-not-align.aspx.
1$ ("#MsgListDiv"). DataGrid ({2 View:detailview,3Detailformatter:function(index,row) {4 return' <div style= ' padding:2px;width:1100 ' ><table class= ' DDV ' ><tr></table></div> ';5 },6Onexpandrow:function(index,row) {7 varDDV = $ ( This). DataGrid (' Getrowdetail ', index). Find (' TABLE.DDV ');8 Ddv.datagrid ({9URL: ' json/faultmainten_queryfm.action?flag=1&pid= ' +Row.pid,TenFitcolumns:false, OneSingleselect:true, ARownumbers:true, -Loadmsg: ", -Height: ' Auto ', the columns:[[ -{field: ' PName ', title: ' Monitoring Point Name ', Width:120,align: ' Center '}, -{field: ' Maintainer ', title: ' Maintenance Person ', Width:70,align: ' Center '}, -{field: ' Maintainertel ', title: ' Phone ', width:90,align: ' Center '}, +{field: ' Faultreason ', title: ' Cause of failure ', Width:70,align: ' Center '}, -{field: ' Hardwarereason ', title: ' Hardware Reason ', Width:80,align: ' Center '}, +{field: ' Softwarereason ', title: ' Software Reason ', width:80,align: ' Center '}, A{field: ' Repairdata ', title: ' Warranty Date ', width:130,align: ' Center '}, at{field: ' Processmode ', title: ' How to handle ', Width:90,align: ' Center '}, -{field: ' Processresult ', title: ' Processing result ', Width:90,align: ' Center '}, -{field: ' ProcessData ', title: ' Processing Date ', Width:130,align: ' Center '}, -{field: ' ProcessContent ', title: ' Concrete handling of content ', Width:110,align: ' Center '} - ]], -OnResize:function(){ in$ (' #MsgListDiv '). DataGrid (' Fixdetailrowheight ', index); - }, toOnloadsuccess:function(){ +SetTimeout (function(){ - varTR = ddv.closest (' tr '),//gets the row of the child table theid = Tr.prev (). attr (' id ');//ID of the row where the parent row of this child table is located *id = id.replace (/-2-(\d+) $/, ' -1-$1 ');//DetailView The ID of the previous part without expansion is regular $$ (' # ' + ID). Next (). CSS (' height ', tr.height ());//sets the height of the front part that is not expanded, because the timer is enabled, it flashesPanax Notoginseng}, 1); - //$ (' Msglistdiv '). DataGrid (' Fixdetailrowheight ', index); the //},0); + }, AOndblclickrow:function(RowIndex, RowData) {//Double-click event the view (rowdata.id); + } - }); $$ (' #MsgListDiv '). DataGrid (' Fixdetailrowheight ', index); $ } -});
Easyui DataGrid DetailView Nesting DataGrid problem