Exporting entire table with TableTools + ASP.NET MVC
Exporting entire table with TableTools + ASP.NET MVC
I am trying to handle the export of an entire table to CSV (not just the displayed results) with jQuery DataTables 1.10.0 using server-side processing with ASP.NET MVC 5.
I have tried using TableTools download (POST + GET) plugin, which I can get to call my controller but I am struggling on how to pass in the DataTable settings (to the JQueryDataTableParamModel object, which is a model to receive parameters from DataTables ajax call in the controller).
One possibility I'd imagine would be to assign the parameters to the aoPost variable but I not clear on how I would pass my DataTable settings. I am using the sample described in http://www.datatables.net/extensions/tabletools/plug-ins, but trying to replace the aoPost values. Or would there be a way send JQueryDataTableParamModel with TableTools?
How would I achieve this? Or if I am going about this the wrong way, any other suggestions on how to integrate TableTools with server side DataTables / MVC controller would be appreciated.
Answers
I managed to find a solution for my issue which I partially have explained in Stack Overflow answer http://stackoverflow.com/questions/23071195/jquery-datatables-export-to-excel/25121340#25121340. Additionally, I removed all legacy syntax which I had used in error and did away with the JQueryDataTableParamModel model (as it binds legacy parameters) and moved to ALMMa/datatables.mvc for model binding (https://github.com/ALMMa/datatables.mvc).