bootstraptable修改合计行内容
html
<table id="detail_ddtable1" class="table table-hover table-striped"></table>
设置表格(msg: ‘detail_ddtable1’ 将msg的值设置为table 的id)
templateTableParams = {
classes: "table table-bordered table-hover",
// url: "${ctx}/puReceiveInfo/puCgddInfoListHT.z",
method: 'post',
contentType: "application/x-www-form-urlencoded",
dataType: "json",
cache: false,
striped: true,
//singleSelect: true,
// showColumns: false,
//clickToSelect: true,
height:$(window).height()*0.7,
// no_overflow_x : true, //默认没有X轴滚动条
showFooter:true,//合计
msg: 'detail_ddtable1',
columns: [
{
checkbox: true,width:'25'
},
{
title: '序号',align:'center',width:'40',
formatter: function (value, row, index) {
return index + 1;
}
},
{
field: 'djh', title: '采购合同号',align:'center',width:'100',halign :'center', formatter :'paramsMatter', footerFormatter: function (value) {return "选择合计"; }
},
{
field: 'xshth', title: '销售合同号',align:'center',width:'100',halign :'center', formatter :'paramsMatter'
},
{
field: 'jhlb', title: '物资类别',align:'center',width:'70'
},
{
field: 'itemCode', title: '物资编码',align:'left',halign :'center',width:'200', formatter :'paramsMatter'
},
{
field: 'itemName', title: '物资名称',align:'left',halign :'center',width:'100', formatter :'paramsMatter'
},
{
field: 'czgg', title: '物资属性',align:'left',halign :'center',width:'100', formatter :'paramsMatter'
},
{
field: 'cgsl', title: '订单数量',align:'right',halign :'center',width:'70', formatter :'paramsMatter'
},
{
field: 'dhsl', title: '已到货数量',align:'right',halign :'center',width:'90', formatter :'paramsMatter'
},
{
field: 'sysl', title: '剩余数量',align:'right',width:'70', formatter :'paramsMatter'
},
{
field: 'cgdj', title: '采购单价',align:'right',halign :'center',width:'70', formatter :'paramsMatter'
},
{
field: 'dw', title: '单位',align :'center',width:'40', formatter :'paramsMatter'
},
{
field: 'jhdhrq', title: '要求采购完成时间',align :'center',width:'150', formatter :'paramsMatter'
},
{
field: 'orderNo', title: '合同号',align:'left',halign :'center',width:'200', formatter :'paramsMatter'
},
{
field: 'cgddmxid', title: 'cgddmxid',align:'left',halign :'center',width:'100', formatter :'paramsMatter', visible: false
},
{
field: 'cghtmxid', title: 'cghtmxid',align:'left',halign :'center',width:'100', formatter :'paramsMatter', visible: false
},
{
field: 'shuil', title: '税率',align:'right',halign :'center',width:'70', visible: false
},
{
field: 'shuie', title: '税额',align:'right',halign :'center',width:'70', visible: false
},
{
field: 'wsdj', title: '无税单价',align:'right',halign :'center',width:'70', visible: false
},
{
field: 'wsje', title: '无税金额',align:'right',halign :'center',width:'70', visible: false
}
,
{
field: 'id', title: 'id',align:'right',halign :'center',width:'70', visible: false
},
{
field: 'purchaseSource',visible: false
}
],
cardView:(function(){ return /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent); })(),
search: false,//页面搜索框
trimOnSearch: true,
idField: 'id',
uniqueId: 'id',
};
$('#detail_ddtable1').bootstrapTable(templateTableParams);
修改合计行的内容
$("#_footer(msg的值) table tbody tr td").eq(8)[0].innerText =“修改内容”;
//修改合计行的第9列内容
$("#_footerdetail_ddtable1 table tbody tr td").eq(8)[0].innerText =“修改内容”;