/*用window.onload调用myfun()*/window.οnlοad=myfun;functionmyfun() {
$("#report").bootstrapTable({
url:'/dashboard',//父表加载数据用到的url
method:'get',
detailView:true,//父子表,为true会在父数据前添加 “+”
//sidePagination: "server",
pagination:false,//是否翻页
pageSize:5,
pageList: [10,25],
columns: [
{ field:'project_name',
title:'项目名称'},
{ field:'domnum',
title:'接入域'}],//注册加载子表的事件。注意下这里的三个参数! row会传递数据到子表
onExpandRow:function(index, row, $detail) {
InitSubTable(index, row, $detail);
}
});//初始化子表格(无线循环)
InitSubTable= function(index, row, $detail) {varparentid=row.business_id;varcur_table=$detail.html('
').find('table');$(cur_table).bootstrapTable({
url:'/sec/dashboard/prodatabybusid',
method:'get',
queryParams: {busid: parentid},
{#ajaxOptions: {strParentID: parentid},#}
clickToSelect:true,
{#detailView:true,//父子表#}
uniqueId:"MENU_ID",
pageSize:10,
pageList: [10,25],
columns: [{
field:'project_name',
title:'项目名称'}, {
field:'domnum',
title:'接入域'}],//无线循环取子表,直到子表里面没有记录
onExpandRow:function(index, row, $Subdetail) {
InitSubTable(index, row, $Subdetail);
}
});
};
};