bootstrap操作⽗⼦表,bootstrap-table⽗⼦表⼊门篇/*⽤load调⽤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',bootstrap项目
title:'项⽬名称'}, {
field:'domnum',
title:'接⼊域'}],//⽆线循环取⼦表,直到⼦表⾥⾯没有记录onExpandRow:function(index, row, $Subdetail) { InitSubTable(index, row, $Subdetail);
}
});
};
};
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论