Tabletools returns [object HTMLInputElement] for each row in oParams rather than name and values.
Tabletools returns [object HTMLInputElement] for each row in oParams rather than name and values.
Trevor
Posts: 31Questions: 0Answers: 0
Alright, I'm banging my head against another wall. When I use Table tools to download the results of a given search the following is returned for what seems to be each row in aoPost: [object HTMLInputElement]. I'm sure I'm simply missing something. I just set aoPost to oParams so all of the params would be sent. Any help would be appreciated!
Example here: http://www.blackmagicms.com/regex/Vendor/sandbox/circuitreport/index_grooming.html
I'm initializing table tools as follows:
[code]
"oTableTools": {
"aButtons": [ {
"sExtends": "download",
"sButtonText": "Download XLS",
"sUrl": "get_data_csv.php"
} ]
},
[/code]
Adding the following button:
[code]
TableTools.BUTTONS.download = {
"sAction": "text",
"sTag": "default",
"sFieldBoundary": "",
"sFieldSeperator": "\t",
"sNewLine": "
",
"sToolTip": "",
"sButtonClass": "DTTT_button_text",
"sButtonClassHover": "DTTT_button_text_hover",
"sButtonText": "Download",
"mColumns": "all",
"bHeader": true,
"bFooter": true,
"sDiv": "",
"fnMouseover": null,
"fnMouseout": null,
"fnClick": function( nButton, oConfig ) {
var oParams = this.s.dt.oApi._fnAjaxParameters( this.s.dt );
var aoPost = oParams;
var aoGet = [];
/* Create an IFrame to do the request */
nIFrame = document.createElement('iframe');
nIFrame.setAttribute( 'id', 'RemotingIFrame' );
nIFrame.style.border='0px';
nIFrame.style.width='0px';
nIFrame.style.height='0px';
document.body.appendChild( nIFrame );
var nContentWindow = nIFrame.contentWindow;
nContentWindow.document.open();
nContentWindow.document.close();
var nForm = nContentWindow.document.createElement( 'form' );
nForm.setAttribute( 'method', 'post' );
/* Add POST data */
for ( var i=0 ; i
Example here: http://www.blackmagicms.com/regex/Vendor/sandbox/circuitreport/index_grooming.html
I'm initializing table tools as follows:
[code]
"oTableTools": {
"aButtons": [ {
"sExtends": "download",
"sButtonText": "Download XLS",
"sUrl": "get_data_csv.php"
} ]
},
[/code]
Adding the following button:
[code]
TableTools.BUTTONS.download = {
"sAction": "text",
"sTag": "default",
"sFieldBoundary": "",
"sFieldSeperator": "\t",
"sNewLine": "
",
"sToolTip": "",
"sButtonClass": "DTTT_button_text",
"sButtonClassHover": "DTTT_button_text_hover",
"sButtonText": "Download",
"mColumns": "all",
"bHeader": true,
"bFooter": true,
"sDiv": "",
"fnMouseover": null,
"fnMouseout": null,
"fnClick": function( nButton, oConfig ) {
var oParams = this.s.dt.oApi._fnAjaxParameters( this.s.dt );
var aoPost = oParams;
var aoGet = [];
/* Create an IFrame to do the request */
nIFrame = document.createElement('iframe');
nIFrame.setAttribute( 'id', 'RemotingIFrame' );
nIFrame.style.border='0px';
nIFrame.style.width='0px';
nIFrame.style.height='0px';
document.body.appendChild( nIFrame );
var nContentWindow = nIFrame.contentWindow;
nContentWindow.document.open();
nContentWindow.document.close();
var nForm = nContentWindow.document.createElement( 'form' );
nForm.setAttribute( 'method', 'post' );
/* Add POST data */
for ( var i=0 ; i
This discussion has been closed.
Replies
That looks dodgy to me - you are trying to write an object to the document. The plug-in on the TableTools plug-in page uses: `nForm.appendChild( nInput );` instead. Have you tried that?
Allan