其實上一篇blog里已經貼了代碼,簡單解釋一下吧:
1、showFooter:?true,很重要,設置footer顯示:
$(cur_table).bootstrapTable({url: '/etestpaper/getPaperQType',method: 'get',queryParams: {strParentID: parentid},ajaxOptions: {strParentID: parentid},showFooter: true,
2、在列中指定footerFormatter函數:
{field: 'questionnum',title: '小題數量',align: 'center',footerFormatter: function (value) {var count = 0;for (var i in value) {count += value[i].questionnum;}return count;}
3、貼個效果圖: