how can I trigger jquery datatables fnServerData to update a table via AJAX when I click a button?

前端 未结 7 977
陌清茗
陌清茗 2020-12-28 17:15

I\'m using the datatables plugin with server-side data and am updating the table using AJAX.

My dataTables setup looks like this:

tblOrders = parame         


        
7条回答
  •  清歌不尽
    2020-12-28 17:44

    From a discussion here, Allan (the DataTables guy) suggests that simply calling fnDraw will yield the results you're looking for. This is the method I use for reloading server-side stuff (via fnServerData, which is important), and it's worked so far.

    $("#userFilter").on("change", function() {
        oTable.fnDraw();  // In your case this would be 'tblOrders.fnDraw();'
    });
    

提交回复
热议问题