How to get all of the values in a single column?
How to get all of the values in a single column?
How do I get all of the values of a single column from a multipage DataTable?
I have tried fnGetData(0) which returns the first row of the table. I've also tried fnGetData(), which returns everything. But how do I get all of the values in column 0 (or 1 or 2) for all of the rows in the table?
Thanks
I have tried fnGetData(0) which returns the first row of the table. I've also tried fnGetData(), which returns everything. But how do I get all of the values in column 0 (or 1 or 2) for all of the rows in the table?
Thanks
This discussion has been closed.
Replies
I need to pass the values to a servlet using ajax so what is the best way to do that? Do I need to format the values of the column into JSON and pass that to the servlet, or is there another way that works better (better meaning more simply).
Thanks again
> I need to pass the values to a servlet using ajax so what is the best way to do that?
With fnServerParams (assuming you are using DataTables to Ajax load the data).
Allan
You'd need to make your Ajax call to the server in the standard jQuery way with the information you want to send, so it can save and update state on the server.
Allan
var oSettings = $('#datatable').dataTable().fnSettings();
var rowCount = oSettings.fnRecordsTotal();
var a = [];
for(var i=0;i
Allan