Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35273

Refresh Data

$
0
0

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


Viewing all articles
Browse latest Browse all 35273

Trending Articles