如何在Javascript中添加jQuery Datatable Footer?

时间:2016-10-05 15:28:17

标签: javascript jquery datatables

我目前正在通过

从我的HTML创建数据表
<table class="stripe" width="100%" id="tableId" />

在JS助手中,我正在设置参数等

drawTable : function(dataSet, component){
    var isSortable   = true; 
    var isSearchable = false;
    var showPaging   = true;
    var dispLength   = 15;
    var tableId      = '#TableId';
    var hdrColsArray = '';
    hdrColsArray = ["header1", "header2",...];
    var aryJSONColTable = [];

.
.
.


 for (var i=0; i < hdrColsArray.length; i++ ) {
        var j = i +1;  

        aryJSONColTable.push({
            "sTitle": hdrColsArray[i],
            "targets": i,
            "visible" :true
        });
    };

 $(function(){
        var rows_selected = [];
        table = $(tableId).DataTable({
            "scrollY": "400px",
            "scrollCollapse": true,
            "destroy": true,
            "responsive": true,
            "paging" : showPaging,
            "pagingType": "full_numbers",
            "columnDefs": aryJSONColTable,
            "iDisplayLength": dispLength,
.
.
.

如何在底部添加页脚以汇总特定列,而无需触摸HTML文件。我想只保留文件中的table元素,但是从JS创建页脚。这可能吗?我该如何处理?

谢谢!

0 个答案:

没有答案