//查询
function searchData() {
var invoiceCode = $(’#invoiceCode’).textbox(‘getValue’);
$(’#center_dg’).datagrid({
view: detailview,
method : ‘get’,
queryParams: {
invoiceCode: invoiceCode
},
url:’/mtPaybackBilling/getMtBillingInfoListOfInvoiceCode’,
detailFormatter:function(index,row){
// return '<div style="padding:2px;position:relative;"><table class="ddv"></table></div>';
return '<table id="ddv-' + index + '"></table>';
},
onExpandRow: function(index,row){
//var ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
$('#ddv-'+index).datagrid({
method : 'get',
url:'/mtPaybackBilling/getMtPaybackBillingList?billingCode='+row.billingCode,
//fitColumns:true,
singleSelect:true,
rownumbers:true,
loadMsg:'',
height:'auto',
columns:[[
// {field:'sewid',width:100 ,sortable:true,title:'预警主键'},
{field:'paybackCode',width:186,sortable:true,title:"回款单号"},
{field:'legalBy',width:80,sortable:true,title:'所有人'},
{field:'endCustomer',width:170,sortable:true,title:'终端客户'},
{field:'invoiceDate',width:100,sortable:true,title:'开票日期',formatter:common.formatDate},
{field:'endInvoiceAmount',width:100,sortable:true,align:'right',title:'开票金额'},
{field:'invoiceCode',width:100,sortable:true,title:'发票编码'},
{field:'paybackDate',width:150,sortable:true,title:'回款日期',formatter:common.formatDate},
{field:'actualAmount',width:100,align:'right',sortable:true,title:'实际回款金额'},
{field:'purchaseInvoiceAmount',width:100,sortable:true,align:'right',title:'采购金额'},
{field:'sumAddTaxAndSurcharge',width:110,align:'right',sortable:true,title:'增值税及附加税'},
{field:'handlingFee',width:100,align:'right',sortable:true,title:'企业所得税'},
{field:'sumTaxAndSurcharge',width:160,align:'right',sortable:true,title:'服务中心增值税及附加'},
{field:'netProfit',width:100,align:'right',sortable:true,title:'净利润'},
{field:'firmInvoiceAmount',width:130,align:'right',sortable:true,title:'服务中心利润100%'},
{field:'firmAmountYesInvoice',width:130,align:'right',sortable:true,title:'服务中心利润20%'},
{field:'firmAmountNoInvoice',width:130,align:'right',sortable:true,title:'服务中心利润80%'},
{field:'mtInvoiceAmount',width:130,align:'right',sortable:true,title:'有限退服务中心利润'},
{field:'factoryInvoiceAmount',width:100,align:'right',sortable:true,title:'慕添付企乘'},
{field:'serviceCenterName',width:200,sortable:true,title:'服务公司名称'}
]],
onResize:function(){
$('#center_dg').datagrid('fixDetailRowHeight',index);
},
onLoadSuccess:function(){
setTimeout(function(){
$('#center_dg').datagrid('fixDetailRowHeight',index);
},0);
}
});
$('#center_dg').datagrid('fixDetailRowHeight',index);
}
});
}
拿到自表格的行:
<button class="easyui-linkbutton" plain=false iconCls="icon-search" onclick="test()" > 测试</button>
function test(){
var parentRow = $("#center_dg").datagrid('getSelected');
var parentSelIndex = $("#center_dg").datagrid('getRowIndex',parentRow);
var sonRow = $('#ddv-'+parentSelIndex).datagrid('getSelected');
}