Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82311

Datatable using server side got error on pagination and filtered row

$
0
0

Hi,
I'm working on datatables inside my website in asp.net. With a huge data, I'm using server side with post to call up list base on page. The data show up nicely inside the table but pagination(endless pagination) and total of row(NaN) not show correctly. Here is the dataSrc part that I send back to datatables to restructured the tables accordingly.

},
 "dataSrc": function (data) {
    var json = $.parseJSON(data.d);

    var myData = {};
    myData.draw = parseInt(json.draw);
    myData.recordsTotal = parseInt(json.recordsTotal);
    myData.recordsFiltered = parseInt(json.recordsFiltered);
    myData.data = json.searchData;

    return myData.data;
 }

In the image is the json data I pass back to dataSrc to structured the table list.
Based on the data, I expect the page will be either show only prev and next button or there is only 1 page, but right now there is endless of page display. The total of row will be 10 but I got NaN.

Can anyone help me. Here is the details if you want other code stackoverflow.com/questions/40544765/jquery-datatable-pagination-and-filter-not-display-correctly


Viewing all articles
Browse latest Browse all 82311

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>