ajax.reload() doesnt seem to work even .DataTable() is observed

ajax.reload() doesnt seem to work even .DataTable() is observed

winrywinry Posts: 2Questions: 1Answers: 0

ajax.reload() does not seem to work? Am i doing something wrong? Did I put the codes on their right places? Am new to datatables so yeah :( thanks in advance!

var datatableInit = function() {

        $('#table-user').DataTable({
            "order": [[ 4, "desc" ]]
        });
        datatableInit.ajax.reload();
    };
    $(function() {
        datatableInit();
    })
}).apply( this, [ jQuery ]);

Answers

  • allanallan Posts: 63,768Questions: 1Answers: 10,510 Site admin

    You haven't defined an ajax option - therefore there is no Ajax to reload!

    Allan

  • winrywinry Posts: 2Questions: 1Answers: 0

    ok sorry but how do i do that? i added

    "ajax": "data.json"
    

    under "order"
    but i get an error message:
    DataTables warning: table id=table-user - Ajax error

This discussion has been closed.