Problem with pager records

Problem with pager records

soporteaehsoporteaeh Posts: 9Questions: 0Answers: 0
edited July 2014 in Free community support

Hello friends, I tell them the problem, I have a calendar which I do record filter, I click on a calendar day and makes the filter well.

The problem is that I have 89 records and if I click on any pager number does function when I click the calendar (the filter function) and if for example I have 5 records with the date filter and I'm 9 pages and I click to page 9, the code sends me to page 9, showing me 0 results, this because I only have a page with 5 records.

What I want to know is how to make the single filter is executed when I click the calendar and not when I click the browser records or when I click the title of the cells to the ascending or descending order.

This is my code

$.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: 'yy-mm-dd',
    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 ) {
        aoData.push( { "name": "datepicker_min2", "value": $("#datepickercalendario").val() } );
        aoData.push( { "name": "datepicker_max2", "value": $("#datepickercalendario").val() } );
    },



    "aaSorting": [[ 0, "desc" ]],

    "aoColumns": [
        { "bVisible":    false },
        { "bVisible":    true },
        { "bVisible":    true },
        { "bVisible":    true },
        { "bVisible":    true },
        { "bVisible":    true },
        { "bVisible":    true },
        { "bVisible":    true },
        { "bVisible":    true },
        { "bVisible":    false },
        { "bVisible":    false }
    ],

    "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
        // Bold the grade for all 'A' grade browsers
        $('td:eq(3)', nRow).html("<a href='"+aData[9]+aData[10]+"m.php?id="+aData[0]+"&categoria="+aData[2]+"&subcategoria="+aData[3]+"'>"+aData[4]+"</a>" );

        $('td:eq(0)', nRow).html( "<a class='iframe' href='fichademuseo2.php?museo="+aData[1]+"'>"+aData[1]+"</a>" );
        return nRow;
    },

    "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: 'yy-mm-dd',
    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();
});
This discussion has been closed.