jquery - Datatables Tabletools Ajax button, how to send all rows -
i need create custom pdf printout specific data table.
i think ajax button it, sends information in table first page, in case 20 rows.
i know can make table show "all records" on screen , click button, don't this, since data available on screen (thousands of rows).
is there other way send data?
i did not found way ajax button, found way. i've used intead:
"otabletools": { "sswfpath": "<?=loc_jquery?>swf/copy_csv_xls_pdf.swf?<?=rand()?>", "abuttons": [ { "sextends": "download", "sbuttontext": "listagens pdf", "surl": "<?=caminho?>_exporta.php", "saction": "text", "stag": "default", "sfieldboundary": "", "sfieldseperator": "\t", "snewline": "<br>", "stooltip": "listagens", "sbuttonclass": "dttt_button_text", "sbuttonclasshover": "dttt_button_text_hover", "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 = [ { "name": "cobranca", "value": $("select#cobranca option:selected").val() }, { "name": "activo", "value": $("select#activo option:selected").val() }, { "name": "id_empresa", "value": $("select#id_empresa option:selected").val() }, { "name": "socio_numero", "value": $("#socio_numero").val() }, { "name": "socio_nome", "value": $("#socio_nome").val() }, { "name": "data1", "value": $("#data1").val() }, { "name": "data2", "value": $("#data2").val() }, { "name": "idade1", "value": $("#idade1").val() }, { "name": "idade2", "value": $("#idade2").val() }, { "name": "empresa_profissao", "value": $("#empresa_profissao").val() }, ]; var aoget = []; /* create iframe 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 */ ( var i=0 ; i<aopost.length ; i++ ) { ninput = ncontentwindow.document.createelement( 'input' ); ninput.setattribute( 'name', aopost[i].name ); ninput.setattribute( 'type', 'text' ); ninput.value = aopost[i].value; nform.appendchild( ninput ); } /* add data url */ var surladdition = ''; ( var i=0 ; i<aoget.length ; i++ ) { surladdition += aoget[i].name+'='+aoget[i].value+'&'; } nform.setattribute( 'action', oconfig.surl ); /* add form , iframe */ ncontentwindow.document.body.appendchild( nform ); /* send request */ nform.submit(); }, "fnselect": null, "fncomplete": null, "fninit": null }, ] }
hope helps in need also.
Comments
Post a Comment