表格同行中存在元素的相互調用,如何保證元素能夠被同行不同列的其他方框使用,方法如下:
頁面元素示例如下:
<div id="MyTableId" class="content-main-container"> <div class="panel panel-primary gd-panel" id="mywindow"> <div class="panel-heading"> <b>TableNameElemnt</b> </div> <div class="panel-body"> <table class="table table-bordered" id="csMemberPackageTable" style="word-break: keep-all;"> </table> </div> </div> </div>
頁面 JS 代碼示例如下:
$(function () {
$('#MyTableId').bootstrapTable('destroy');
$("#MyTableId").bootstrapTable({
url:'/*** /*** Action_*** List.action',
dataType: "json",
showRefresh: true,
striped: true,
cache: true,
undefinedText: "-",
sortName: "id",
sortOrder: "asc",
pagination: true,
sidePagination: "server",
toolbar: "#toolbar",
pageNumber:1,
pageSize:3,
smartDisplay:true,
pageList:[5,10,25,50],
paginationPreText: "上一頁",
paginationNextText: "下一頁",
columns: [{
checkbox: true
},
{
field:'pId',
title:'操作',
align:'center',
formatter:function(value,row,index){
var aId = row.aId;
var bId = row.bId;
var cId = row.cId;
var a =
'<a href="/**** /**** Action_**** GoJsp.action?ResObj.' +
'pId='+pId+'&ResObj.aId='+aId +
'&ResObj.bId='+bId+
'&ResObj.cId='+cId+
'"'+'class="cs_menuTab"> 編輯全部 Id </a>';
return a;
}
},{
field: "aId",
title: "A 標簽",
align: "center"
},
{
field: "bId",
title: "B 標簽",
align: "center"
},
{
field: 'cId',
title: 'C 標簽',
align: 'center'
}]
});
});
以上所述是小編給大家介紹的BootStrap Table 獲取同行不同列元素的方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對網站的支持!