TableTools and Server Side PipeLine

TableTools and Server Side PipeLine

alexsiagianalexsiagian Posts: 5Questions: 0Answers: 0
edited May 2011 in TableTools
my problem is when export, it will export shown data not all data,,
how i can export all data using server side pipe line??
need your help?

[code]
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "server_processing.php",
"fnServerData": fnDataTablesPipeline
[/code]

i'm using TableTools v2.0.1 and
DataTable v1.7.6

thx

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Can I ask - why the repost: http://datatables.net/forums/comments.php?DiscussionID=5126&page=1#Item_0 ? It looks like a duplicate. Please ask your question only once so we have a chance of keeping track of questions! I'm sorry that you didn't get a reply to your original thread - there are only so many hours in the day and I'm just one person!

    Basically the issue is that the export is being done client-side, but since you are using server-side processing not all the data is available on the client-side. So if you want all the data you have two options:

    1. You can make an Ajax request to get all of the data and then export it on the client-side - this could be done with the 'ajax' button in TableTools and will likely require a few changes to your server-side script

    2. You can send a request to the server to create the XLS / CSV on the server and then download it.

    Allan
  • alexsiagianalexsiagian Posts: 5Questions: 0Answers: 0
    really sorry about my post, the 1st post i think it is wrong category, i try to delete but i can't, i'm only sink it, so i create the new one in 'TableTools' Category.. i'm new in this forum.. sorry about that.

    for the solution that you provided,
    I've seen in http://www.datatables.net/extras/tabletools/button_options#ajax_options,
    but what kind of file contents 'remote.php', it does the same with the file server_processing.php??

    [code]
    $(document).ready( function () {
    $('#example').dataTable( {
    "sDom": 'T<"clear">lfrtip',
    "oTableTools": {
    "aButtons": [
    {
    "sExtends": "ajax",
    "sAjaxUrl": "remote.php"
    }
    ]
    }
    } );
    } );
    [/code]


    thx
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Basically yes. The remote.php will need to read your database and then output the data in whatever format you need. You'll also need to define fnAjaxComplete for the Ajax button in order to have it do something with whatever is returned from the server.

    Allan
This discussion has been closed.