let t_abonos;
document.addEventListener('DOMContentLoaded', function(){
    //DataTables Abono Compras - Ajax
    t_abonos = $('#t_abonos').DataTable({
        "aPreocesing": true,
        "aServerSide": false,
        "ajax": {
            "url": "" + base_url + 'creditocompras/listar_abonos',
            "dataSrc": ""
        },
        "columns": [{
                "data": "id"
            },
            {
                "data": "nombre"
            },
            {
                "data": "monto"
            },
            {
                "data": "fecha"
            },
            {
                "data": "acciones"
            }
        ],
        "dom": "<'row'<'col-sm-4'l><'col-sm-4 text-center'B><'col-sm-4'f>>" +
            "<'row'<'col-sm-12'tr>>" +
            "<'row'<'col-sm-5'i><'col-sm-7'p>>",
        buttons,
        language,
        "resonsieve": true,
        "bDestroy": true,
        "iDisplayLength": 10,
        "order": [
            [0, "desc"]
        ]
    });

    $('#min').change(function (e) {
        t_abonos.draw();
    });
    //Busqueda por Rango de Fechas DataTables - Hasta
    $('#max').change(function (e) {
        t_abonos.draw();
    }); 
})