TableTools date range

TableTools date range

mf_a2ifmf_a2if Posts: 32Questions: 0Answers: 0
edited February 2013 in TableTools
Hi all,

I use TableTools, with download function and it's work.
When I use filters, it's good but I don't know why, when I use a date range filter, in my export, I don't have this filter.
However, the filter is working in my datatable.

Can you help me ?

Code JS
[code]
TableTools.BUTTONS.download = {
"sAction": "text",
"sTag": "default",
"sFieldBoundary": "",
"sFieldSeperator": "\t",
"sNewLine": "
",
"sToolTip": "",
"sButtonClass": "DTTT_button_text",
"sButtonClassHover": "DTTT_button_text_hover",
"sButtonText": "Download",
"mColumns": "all",
"bHeader": true,
"bFooter": true,
"sDiv": "",
"fnMouseover": null,
"fnMouseout": null,
"fnClick": function( nButton, oConfig ) {
var oParams = this.s.dt.oApi._fnAjaxParameters( this.s.dt );
var iframe = document.createElement('iframe');
iframe.style.height = "500px";
iframe.style.width = "1000px";
iframe.src = oConfig.sUrl+"?"+$.param(oParams);
document.body.appendChild( iframe );
},
"fnSelect": null,
"fnComplete": null,
"fnInit": null
};

$(document).ready(function() {
// Affichage du tableau avec le détail des entrées
$('#tabDetail').dataTable({
"aaSorting": [[ 1, 'desc' ]],
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"aButtons": [{
"sExtends": "download",
"sButtonText": "EXCEL",
"sUrl": "extranet/scriptPHP/csvGeneral.php"
},{
"sExtends": "download",
"sButtonText": "PDF",
"sUrl": "extranet/scriptPHP/pdfGeneral.php"
}]
},
"sAjaxSource": "extranet/scriptPHP/serverSideGeneral.php",
"fnServerData": function( sUrl, aoData, fnCallback ) {
$.ajax( {
"url": sUrl,
"data": aoData,
"success": fnCallback,
"dataType": "json",
"cache": false
} );
}
}).columnFilter({
aoColumns: [{ type: "text" },
{ type: "date-range"},
{ type: "time-range" , values: ["07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"]},
{ type: "select", values: ['muret', 'labarthe']}]
});
});
[/code]

csvGeneral.php code :
[code]
<?php
//envoi des headers csv
header('Content-type: text/csv');
header('Content-Disposition: attachment; filename="Detail des entrees.csv"');

// Champs de la base de données
$aColumns = array( 'usager', 'date', 'heure', 'decheterie', 'commune', 'etat');
// Table
$sTable = "te_stats";
// Connexion à la base
include("../inc/gestiondech_config.inc.php");

// Eventuels filtres
$sWhere = "";
if ( $_GET['sSearch'] != "" ){
$sWhere = "WHERE (";
for ( $i=0 ; $i

Replies

  • mf_a2ifmf_a2if Posts: 32Questions: 0Answers: 0
    In fact, the $_GET[sSearch_1] (date range) is void, but datatable change when I use it and I see it in Firebug.

    Why it's not sending to the csv script ?

    Magali
  • mf_a2ifmf_a2if Posts: 32Questions: 0Answers: 0
    Allan, can you help me please ?
    I don't find solution
  • mf_a2ifmf_a2if Posts: 32Questions: 0Answers: 0
    Ok, thank you for your help :) (joke of course)

    I have finally find a solution with method POST of TableTools and DOWNLOAD.

    Magali
  • kimihakkimihak Posts: 1Questions: 0Answers: 0
    Hello,

    I have the same problem as you. Export CSV works fine without filter range. When i fill my date range nothing is send to the server but the datatable is updated with the new data. I try the Post method nothing happens. Can you help me please.
    Thank you in advance.

    Kimi
This discussion has been closed.