Changing columns dynamically with angular-datatables

后端 未结 2 507
刺人心
刺人心 2021-01-28 06:29

I am using angular datatables, an angularized version of the popular jquery datatables library.

Here is my html



         


        
2条回答
  •  终归单人心
    2021-01-28 06:51

    Faced the same issue in my project.

    vm.table.dtInstance.DataTable.destroy();
    angular.element('#table-id').children('thead').children().remove();
    angular.element('#table-id').children('tbody').children().remove();
    vm.table.dtColumns = columnsList;
    

    Helped for me. It deletes whole datatable and creates it from scratch when you set new columns list.

提交回复
热议问题