TableTools click on Print: sets length = -1 causing an ajax error
TableTools click on Print: sets length = -1 causing an ajax error
Terradon
Posts: 16Questions: 5Answers: 2
I have added TableTools to my DataTable, looks well of course, but my first try to click on the Print button cause an ajax error. Looking at Firebug, I see lenght is set to a value of -1. Which of course results in an ajax error due to a negative limit in my query.
For testing : when serverside correcting $_GET['length'] to 10, it works fine.
Why is length set to -1 and how can i change this to the present length of my table?
My code for implementing TableTools
$("#mijnlogboek").DataTable({
"processing": true,
"serverSide": true,
"lengthMenu": [[10,50,200,500,-1], [10,50,200,500,"Alles"]],
"pagingType": "full_numbers",
language: {url: '//cdn.datatables.net/plug-ins/f2c75b7247b/i18n/Dutch.json'},
"order": [[ 0, "desc" ]],
"ajax": "jq_datatables/mijnlogboek.php?playerID='.$_SESSION['playerID'].'",
"dom": \'T<"clear">lfrtip\',
"tableTools": {
"sSwfPath": "jq_datatables/extentions/TableTools/swf/copy_csv_xls_pdf.swf"
}
})
This discussion has been closed.
Answers
One problem found: sSwfPath typo.
changed extentions to extensions :)
So everything works now, except: PRINT sents an ajaxcall with value for length = -1
tried after changing rows to 50, still -1 is being sent as value for length.
other strange side-effect: i have got 2 selects for changing amount of rows, both works
anyone any idea? I am desperade now :(
The side-effect of displaying the select rows twice is gone now, typo with clear.
Last remaining error: Parameter length is set to -1 (negative 1 ????).
After one week i have almost reached the finish, so please??