TableTools Print + Serverside
TableTools Print + Serverside
Hi Allan, i use a serverside datatable (with pagination 10 row) and now i add the plugin tabletools for print all the table records (133 records).
First i have the problem that the print function don't display all the record of the table but only the record in the pagination(10). So i watch the TableTool js and discover that the problem is in the variable:
[code]
"_DTSettings._iDisplayLength = -1;"
[/code]
that block the sql query in the LIMIT field, so i replace with this:
[code]
"_DTSettings._iDisplayLength = _DTSettings._iRecordsTotal;"
[/code]
and now seems to work good.
Now there is a second problem that I can not understand: when press the button "Esc" to return to the table, i receive an error in firebug console:
[code]
json is null
if ( typeof json.sEcho != 'undefined' )
jquery...bles.js (riga 2751)
[/code]
and return the table with all the records (133) without pagination and the message "Loading..." in the middle.
Best regards.
First i have the problem that the print function don't display all the record of the table but only the record in the pagination(10). So i watch the TableTool js and discover that the problem is in the variable:
[code]
"_DTSettings._iDisplayLength = -1;"
[/code]
that block the sql query in the LIMIT field, so i replace with this:
[code]
"_DTSettings._iDisplayLength = _DTSettings._iRecordsTotal;"
[/code]
and now seems to work good.
Now there is a second problem that I can not understand: when press the button "Esc" to return to the table, i receive an error in firebug console:
[code]
json is null
if ( typeof json.sEcho != 'undefined' )
jquery...bles.js (riga 2751)
[/code]
and return the table with all the records (133) without pagination and the message "Loading..." in the middle.
Best regards.
This discussion has been closed.
Replies
I'm having exactly the same issue. Did you find solution?
Alan, any clue?
Why can't we also have a similar functionality for the export to excel/csv buttons? Can't we retrieve all the data prior to export? As of now, only the visible data is exported to excel.
Thx and regards
Philippe
when press the button "Esc" to return to the table, i receive the same error in firebug console.
Nobody can help us?
Thanks very much
I found this thread discussing the issue: http://www.sencha.com/forum/showthread.php?61694-Ajax-request-failed-when-esc-key-pressed
I haven't been able to reproduce this in other browsers - I'll investigate more and file a bug against Mozilla if someone hasn't already. Until then, a work around is to replace this line:
[code]
$(document).bind( "keydown", null, fnPrintEnd );
[/code]
with
[code]
$(document).bind( "keydown", null, function(e){setTimeout(function(){fnPrintEnd(e)},20)} );
[/code]
I'll incorporate this into the next release of TableTools.
@pgraca - TablesTools was really designed for the client-side only - although obviously it works to some extent with server-side processing. Since DataTables with server-side processing only knows about the display elements - this is what you get when you try to save a file on the client-side. There are a few options - 1. Get the whole data set by XHR and then put it into the client-side processing options, 2. Send an XHR asking the server to generate the XSL etc for you. Both will be somewhat easier with TableTools 2...
Regards,
Allan