Send table data back to server for export
Send table data back to server for export
Hi everyone!
I want to be able to send the currently filtered, sorted data from a datatable back to the server, so that once on the server I can process it (ultimately into an Excel file, but I can't use TableTools because of the way I need to format the data..).
I assume I need to do something with fnGetFilteredNodes and serialize the data in some way to post it back to the server for processing.. has anyone got any clues? I'm a bit of a newbie with jQuery / web dev in general so be gentle with me!
I want to be able to send the currently filtered, sorted data from a datatable back to the server, so that once on the server I can process it (ultimately into an Excel file, but I can't use TableTools because of the way I need to format the data..).
I assume I need to do something with fnGetFilteredNodes and serialize the data in some way to post it back to the server for processing.. has anyone got any clues? I'm a bit of a newbie with jQuery / web dev in general so be gentle with me!
This discussion has been closed.
Replies
I was using fnGetFileredData and then looping through the results to build up the data in JSON structure. I'm pretty awful at JavaScript myself so I'd like to see some other solutions, but here is a function from my notes that was working as far as it goes...
[code]
$(document).ready( function() {
$('#classSummary').click( function () {
var myTable=new Array();
var myJSON;
myJSON = '{"bindings": [';
var aNodes = oTable.fnGetFilteredData();
for ( var i=0, iLen=aNodes.length ; i