jquery - Access Datatables recordsFiltered field? -


i have such jquery request:

        jquery(function()                  {                        jquery('#numberlist').datatable({                          "processing": true,                         "serverside": true,                         "ajax": "${baseurl}voip/provisioning/ajax/dtsearch/" + addtype,                         "columns": [                                     { "data": "number" },                                     { "data": "type" },                                     { "data": "targetdisplay" },                                     { "data": "lastchanged" },                                     { "data": "triple9data" },                                     { "data": "portingin" },                                     { "data": "edit" }                                 ],                         "columndefs": [                                        {                                            "render": function (data, type, row) {                                                 row.edit = '<input id="numbercheckbox' + row.id + '" type="checkbox" name="number" value="' + row.id + '"/>';                                                 return data;                                            },                                            "targets": 0                                        },                                 ]                     });                      jquery("#list_filter label input").attr("placeholder", "search...");                  }); 

i need access.

$("#pager_total").text(recordsfiltered); 

on every json return. not access:

recordsfiltered 

how access it?

$("#pager_total").text(data.length); 

use ajax.datasrc option define callback called after each successful ajax request.

use following initialization options:

"ajax": {    "url": "${baseurl}voip/provisioning/ajax/dtsearch/" + addtype,    "datasrc": function(json){       $("#pager_total").text(json.recordsfiltered);        return json.data;    } } 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -