I am using AngularJS with Angular-datatables (http://l-lin.github.io/angular-datatables/) and I am using the datatables ColVis plugin. The table renders fine but sorting the column headers OR using the ColVis show/hide columns removes all data:

When viewing the network, this is what their data source looks like - http://l-lin.github.io/angular-datatables/data.json?_=1417925914539 .

Simply recreate that data file, load that in data using DTOptionsBuilder.fromSource(PATH_TO_FILE), and you should be good to go.

Let me know if you have any issues.

网友答案:

@Dom,

Please see the screenshot, here the method is working fine but when calling this method from second api success response with new data the UI will not getting change or if I used $apply for invoke manually then the data table started behave weird.