数据表中的固定列声明后不重新加载数据表

时间:2014-12-02 14:39:24

标签: jquery datatables jquery-datatables

我正在尝试在更新和插入等操作后重新加载数据表。第1列是固定列,如果我使用固定列代码,数据表没有重新加载,请有人告诉我如何避免冲突,这是我的代码:

$(document).ready(function () {
var datetime = $.now();
table=$('#ReportTable').dataTable({
    "bProcessing": true,
    "bDestroy": true,
    "bPaginate": false,
    "bJQueryUI": true,
    "sScrollX": "100%", //This is what made my columns increase in size.
    "sDom": '<"H"TClr>t<"F"ip>',
    "oTableTools": 
       {
         "sSwfPath": "/itmsmaps/htdocs/copy_csv_xls_pdf.swf",
         "aButtons": [
                          {
                               "sExtends": "xls",
                               "mColumns": [ 0, 1, 2, 3,4,5,6,7],
                               "sFileName": "MAPSResults - "+datetime+".csv"
                           },
                         ]

         },

    "ajax" :{

        url: 'ajax_call.php',
        type: "POST",
        data: {
            action:'loadData'
        }   
    },
    "columnDefs": [ 
                   { 
                    "mData": null, 
                    "bSortable": false,
                    "mRender": function(data, type, full)
                     {
                         id=full[8];
                         var returnval = "<td><div class='main'><div class='panel'><a  href=#join_form  id='join_pop' onclick=\"addData('"+id+"','edit');\">Edit</a></div></div>";
                         returnval += "<div class='main'><div class='panel'><a href=#join_form  id='join_pop' onClick=\"deleteData('"+id+"');\">Delete</a></div></div></td>";
                         return returnval;
                     },
                   "aTargets":8  // this your column of action        
                    }
                  ]


});

new $.fn.dataTable.FixedColumns( table, {
     leftColumns: 1
 } );

});

 }

1 个答案:

答案 0 :(得分:0)

我已经将那些固定列JS文件下载到本地环境,然后它正在运行