problem with Datatables and datepicker

problem with Datatables and datepicker

soporteaehsoporteaeh Posts: 9Questions: 0Answers: 0

Hello friends, I have a problem, I happen to have a calendar datepicker to filter events, events the show with datatables, the thing is that when you start the page shows all the events and what is required, the thing is that when I select a calendar date of datepicker should filter events by date, the question is no longer filter these events, returns to all events, and i was trying to print variables from server_processing but gets nothing, ie when select a date is not sent to the server_processing to filter events.

here I leave the code datatables

$(document).ready(function(){
$.datepicker.regional['es'] = {
closeText: 'Cerrar',
prevText: '<Ant',
nextText: 'Sig>',
currentText: 'Hoy',
monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
monthNamesShort: ['Ene','Feb','Mar','Abr', 'May','Jun','Jul','Ago','Sep', 'Oct','Nov','Dic'],
dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
weekHeader: 'Sm',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''
} ;

$.datepicker.setDefaults($.datepicker.regional['es']);

var oTable = $('#example').dataTable( {
    "sPaginationType": "full_numbers",
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "server_processing.php",
    "fnServerParams": function (aoData, fnCallback) {

                   /*EN ESTA PARTE YA PUSE UN ALERT PARA VER QUE LLEGUE HASTA ESTE PUNTO PERO NO ENTRA AQUI, ES DECIR, ESTE ALERT NUNCA SE EJECUTA, POR LO CUAL PIENSO QUE NUNCA LE ENVIA LAS VARIABLES A SERVER_PROCESSING*/


        aoData.push(  {"name": "datepicker_min2", "value":  $('#datepickercalendario').val() } );
        aoData.push(  {"name": "datepicker_max2", "value":  $('#datepickercalendario').val() } );
    },

    "oLanguage": {
        "sLengthMenu": "Mostrando _MENU_ eventos por página",
        "sZeroRecords": "No se encontro Nada - Disculpe",
        "sInfo": "Mostrando _START_ de _END_ de un total de _TOTAL_ eventos",
        "sInfoEmpty": "Mostrando 0 de 0 de un total de 0 eventos",
        "sInfoFiltered": "(filtrados de _MAX_ total de eventos)",
        "sSearch": "Buscar",
        "oPaginate": {
            "sFirst": "Primera",
            "sLast": "Última",
            "sNext": "Siguiente",
            "sPrevious": "Anterior"
        }
    }
});

$( "#datepickercalendario" ).datepicker ( {
    dateFormat: 'dd/mm/yy',
    numberOfMonths: 1,
    "onSelect": function(date) {
        min = new Date(date).getTime();
        max = new Date(date).getTime();
        oTable.fnDraw();
    }
})

.keyup( function () {
    DateFilter = new Date(this.value).getTime();
    DateFilter = new Date(this.value).getTime();
    oTable.fnDraw();
});  

Replies

This discussion has been closed.