Pagination issues

Pagination issues

FlaterFlater Posts: 4Questions: 0Answers: 0
edited December 2011 in General
* File: jquery.dataTables.min.js
* Version: 1.8.2

Hey everyone,

First of all, I love DataTables, it contains a lot of features people can put to good use.

I am however facing an issue in which I cannot instruct DT to do nothing... :)

Basically, what's happenings is as follows:
I have an MVC application, and my controller already splits a list into pages before loading the page. So when the page is loaded, all items that are in the tables should be shown in the datatable.
However, I need to enable "bPagination", because of the fnInit function I need to call to add my own pager and have it update etc.
Therfore, I need a way to tell DataTables to paginate its content with a length of its contents (therefore displaying it on a single page). However, I cannot set it up correctly. I've been trying to Edit "iDisplayLength", Here's what I've tried:

"iDisplayLength": -1,
"iDisplayLength": my_int_of_total_item_count,
"iDisplayLength": 250,
"iDisplayLength": 10000000000,

But regardless of what I enter, In Internet explorer I get 20 items. In Firefox I get 10 items (strangely). My Controller is passing the full list and if I inspect my page source, I do get all items. But Datatables keeps paginating the content.
I deleted my cookies/history/.... If I add a random alert in the code, that alert is shown, so I know it's not a caching issue.

Here's my current initialisation:

oTable = $(tableID).dataTable({
"sDom": 'R<"H"C>t<"F"ip>',
"bJQueryUI": true,
//"bAutoWidth": false,
"sScrollX": "100%",
"sScrollY": 500,
"bScrollCollapse": false,
"bPaginate": true,
"bFilter": false,
"bSort": false,
"bStateSave": true,
"sPaginationType": "custom",
"bLengthChange": false,
"iCookieDuration": 60 * 60 * 24 * 360, /*1 year */
"iDisplayLength": -1,
"aLengthMenu": [[-1], ["All"]],
"oLanguage": {
"sInfo": $("#infoString").val()
},
"fnCookieCallback": function (sName, oData, sExpires, sPath) {
return cookiemanipulator(sName, oData, sExpires, sPath);
},
"aoColumnDefs" : colwidths

});

I know some solution may be unorthodox, but everything is working except for the # of items displayed on a page...
I've tried several options but DataTables seems to ignore my settings and keeps paginating per 20 items (or 10 in FireFox, strangely enough).

Anyone have an idea how I can fix this?
This discussion has been closed.