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.

TrevorTrevor Posts: 31Questions: 0Answers: 0
edited October 2012 in TableTools
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

Replies

  • TrevorTrevor Posts: 31Questions: 0Answers: 0
    Update, when I manually set the parameters for aoPost, I get the same thing; once for each pair of parameters I've set.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    > document.write(nInput);

    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
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Link to plug-ins page: http://datatables.net/extras/tabletools/plug-ins
This discussion has been closed.