第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

數(shù)據(jù)表PDF導出自定義總和元素

數(shù)據(jù)表PDF導出自定義總和元素

ibeautiful 2021-04-01 13:14:50
使用Datatables v1.10我想導出我的表,包括表外的HTML元素,其中包括薪金列的總和-這可能嗎?該總和是動態(tài)變化的,單擊按鈕時應導出實時結(jié)果。我創(chuàng)建了一個表,該表可以成功過濾,顯示總數(shù)并導出帶有自定義消息的PDF,但是我不確定如何將total元素添加到PDF。我希望PDF布局如下:PDF標題工資總額表內(nèi)容我在這里創(chuàng)建了一個小提琴,下面是代碼。window.onload = function() {  $(document).ready(function() {    $('#example').DataTable({      dom: 'Bfrtip',      buttons: [{        extend: 'pdfHtml5',        messageTop: 'PDF created by PDFMake with Buttons for DataTables.'      }],      "footerCallback": function(row, data, start, end, display) {        var api = this.api(),          data;        // Remove the formatting to get integer data for summation        var intVal = function(i) {          return typeof i === 'string' ?            i.replace(/[\$,]/g, '') * 1 :            typeof i === 'number' ?            i : 0;        };        // Total over all pages        total = api          .column(4)          .data()          .reduce(function(a, b) {            return intVal(a) + intVal(b);          }, 0);        // Total over this page        pageTotal = api          .column(4, {            page: 'current'          })          .data()          .reduce(function(a, b) {            return intVal(a) + intVal(b);          }, 0);        // Update footer        $(api.column(4).footer()).html(          '$' + pageTotal + ' ( $' + total + ' total)'        );        $('#total').text('£' + Number(pageTotal).toFixed(2));      }    });  });}
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 168 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號