Cannot reinitialise JQuery DataTable

前端 未结 9 649
北恋
北恋 2020-12-13 19:32

I\'m using jquery datatables to display data inside grid. On init page load script take DateTime.Today and process them further, problem is after init page load, when I\'m t

9条回答
  •  无人及你
    2020-12-13 19:51

    The first thing you wanna do is to clean and destroy your datatables.

    var tables = $.fn.dataTable.fnTables(true);
    
    $(tables).each(function () {
      $(this).dataTable().fnClearTable();
      $(this).dataTable().fnDestroy();
    });
    

    and then re-create.

    $("#datagrid").dataTable();
    

提交回复
热议问题