Refresh Data

Refresh Data

h40s4m4h40s4m4 Posts: 1Questions: 1Answers: 0
edited July 2014 in Free community support

Hello :D:

Well, i have a, probably, stupid problem whit datatables + asp.net mvc4, my script is

$(document).ready(function () {

    var arrayDatos = {
        'canal': $(" ListaCanales ").val(),
        'anio': $(" ListaAnios ").val(),
        'vendedorsigla': $(" #ListaVendedores ").val()
    };

    var datatable = $('informe').dataTable({
        "language": { "url": "http://cdn.datatables.net/plug-ins/28e7751dbec/i18n/Spanish.json" },
        "bFilter": false,
        "processing": true,
        "serverSide": true,
        "ajax": {
            "url": "mensualajax",
            "type": "POST",
            "dataType": "json",
            "data": arrayDatos
        },
        "columns": [                
            { "data": "Mes", "bSortable": false },
            { "data": "TotalCredito" },
            { "data": "TotalClientes" },
            { "data": "Balance7" },
            { "data": "Balance37" },
            { "data": "Balance67" }               

        ],            
    });

    $(" #FiltrarResultados ").click(function () {

        var arrayDatos = {
            'canal': $(" ListaCanales ").val(),
            'anio': $(" ListaAnios ").val(),
            'vendedorsigla': $(" ListaVendedores ").val()
        };

        datatable.fnDraw();
    });
});

basically, arrayDatos is a filter, i need reload the page, but when i apply datatable.fnDraw(), not change the arrayDatos passed to the script (this work by default conf (populate the table with de query) but doesn't work when "click" ).

Best Regards

This discussion has been closed.