TableTools Print + Serverside

TableTools Print + Serverside

petpet Posts: 9Questions: 0Answers: 0
edited March 2010 in General
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.

Replies

  • pgracapgraca Posts: 1Questions: 0Answers: 0
    edited May 2010
    Pet, thanks for the tip
    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
  • tlorenzo80tlorenzo80 Posts: 3Questions: 0Answers: 0
    I have the same problem!!!
    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
  • tlorenzo80tlorenzo80 Posts: 3Questions: 0Answers: 0
    Nobody can help us??? :(
  • davidwburnsdavidwburns Posts: 1Questions: 0Answers: 0
    Seriously, a little help? I'm having this problem as well.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Sorry for the delay in addressing this all. It looks like it is a bug in Firefox (which I presume you are all using?). If you issue an Ajax request in an event handler for the 'esc' key, then the XHR would appear to be cancelled... terrible.

    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
This discussion has been closed.