table tools server side processing, passing $output to the iframe

table tools server side processing, passing $output to the iframe

toontilleytoontilley Posts: 8Questions: 0Answers: 0
edited January 2013 in Plug-ins
My coding knowledge is not the greatest but what I want to do is pass the $output variable from my server-side-processing.php script to the iframe thats generated with the download button for table tools.

I'm using the $_POST method at the moment.

I tried my hardest and I think I need to do something with the fnCallBack function but would really appreciate some help from the experts.

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Like the 'Download (POST + GET)' plug-in: http://datatables.net/extras/tabletools/plug-ins ?

    Allan
  • toontilleytoontilley Posts: 8Questions: 0Answers: 0
    Hi Allan

    Yes like the Download ($POST + GET),

    Many thanks

    Mark
  • toontilleytoontilley Posts: 8Questions: 0Answers: 0
    Basically I've altered the $sQuery in the script so I can send in some $_POST values from a form on screen. I then use the filter option in datatables to narrow down the result.

    I want to be able to export the result set to CSV, in some cases (2000 records)

    I have added my $sQuery to the $output

    $output = array(
    "sQuery" => $sQuery,
    "sEcho" => intval($_GET['sEcho']),
    "iTotalRecords" => $iTotal,
    "iTotalDisplayRecords" => $iFilteredTotal,
    "aaData" => array()
    );

    I wanted to pass sQuery to the iframe run the query and create the CSV file.

    I tried to use the table tools plugin but it was only exporting 100 records, which I am guessing would be the ones server-side had returned.

    Hope this all makes sense

    Cheers

    Mark
  • toontilleytoontilley Posts: 8Questions: 0Answers: 0
    Any thoughts anyone?

    Cheeky bump
  • toontilleytoontilley Posts: 8Questions: 0Answers: 0
    Resolved after many attempts, as I wanted to use the $_POST data (posted from a custom form) along with the filter "input field data" I ended up using the get method of the pluginand altering the frame.src value like this

    [code]iframe.src = oConfig.sUrl+"?v="+$('div.dataTables_filter input').val()+'&'+'p='+$_POST['company_name']+'&'$.param(oParams);[/code]

    Now I have the values that I need in $_GET along with oParms, I can now restructure my query in the iframe to create the csv file that I required.

    Hope this helps other people, who are trying to download data using the server side method

    Regards Mark
This discussion has been closed.