paging buttons are disabled on server side processing

paging buttons are disabled on server side processing

jihohanjihohan Posts: 4Questions: 0Answers: 0
edited April 2010 in General
I have server side implemented with ASP.NET MVC.

This is the querystring:

GET /RawData/GetData?sEcho=1&iColumns=5&sColumns=&iDisplayStart=0&iDisplayLength=10&iSortingCols=1&iSortCol_0=0&sSortDir_0=asc&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=true&bSortable_4=true&tablename=COF_Allocations HTTP/1.1

And this is what i get back:

[code]{"iTotalRecords":1700,"iTotalDisplayRecords":10,"sEcho":1,"sColumns":"Date,Entity,Item,Target,Allocation","aaData":[["2/18/2010 12:00:00 AM","PBI","dummy","dummy","0"],["2/18/2010 12:00:00 AM","PBI","dummy","dummy","0"],["2/18/2010 12:00:00 AM","PBI","dummy","dummy","0"],["2/18/2010 12:00:00 AM","PBI","dummy","dummy","0"],["2/18/2010 12:00:00 AM","PBI","dummy","dummy","-67.1639"],["2/18/2010 12:00:00 AM","PBI","dummy","dummy","-35.6084"],["2/18/2010 12:00:00 AM","PBI","dummy","dummy","-27.0194"],["2/18/2010 12:00:00 AM","PBI","dummy","dummy","-96.5742"],["2/18/2010 12:00:00 AM","PBI","dummy","dummy","-82.9046"],["2/18/2010 12:00:00 AM","PBI","dummy","dummy","-0.6403"]]}[/code]

I have the bar at the bottom say:

Showing 1 to 10 of 10 entries (filtered from 1700 total entries)

and the paging buttons are disabled.

One, I'm not sure why they are disabled. Two I don't know why it says "filtered from" when I'm not really filtering.

Here's my setup:

[code]
$(document).ready(function() {
dataTable = $("#datatable").dataTable({
"bFilter": false,
"bJQueryUI": true,
"bPaginate": true,
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "/RawData/GetData",
"fnServerData": function(url, data, callback) {
data.push({ "name": "tablename", "value": "<%= Model.TableName %>" });
$.ajax({
"dataType": "json",
"type": "GET",
"url": url,
"data": data,
"success": callback
});
}
});
});
[/code]

Am I missing something here?

Replies

  • jihohanjihohan Posts: 4Questions: 0Answers: 0
    I was missing something here - my brain!

    iTotalDisplayRecords should have been set to same as iTotalRecords (since there is no filter).
    Now the paging is enabled and works.
  • CassiannoCassianno Posts: 19Questions: 0Answers: 0
    I had the same problem :P
  • robbiesmith79robbiesmith79 Posts: 16Questions: 0Answers: 0
    Here's my problem and solution:
    http://datatables.net/forums/comments.php?DiscussionID=2872&page=1
This discussion has been closed.