How do I refresh/reload my DataTable from HTML source

后端 未结 2 938
抹茶落季
抹茶落季 2020-12-21 11:13

I\'m using BackboneJS to populate my table with multiple data sources. You do not need to know Backbone to assist in this question, as the issue is mainly a

2条回答
  •  悲哀的现实
    2020-12-21 12:08

    Use rows().invalidate() to invalidate the data held in DataTables for the selected rows.

    For example, to invalidate all rows using original data source:

    var table = $('#example').DataTable();
    
    table
        .rows()
        .invalidate()
        .draw();
    

    Please note that draw() will reset the table to the fist page. To preserve the page, use draw(false) instead.

提交回复
热议问题