iDisplayStart = NaN in dataTables v 1.8.2
iDisplayStart = NaN in dataTables v 1.8.2
Hi all,
I'm using dataTables version 1.8.2 in a Python/Pylons application and using the sAjaxsource property to page the data on the server side. This works really well, but I've got two problems:
1) The "Next" button on the pagination part of the display doesn't do anything, all the other buttons function as I'd expect, rebuilding the table with the data for that page.
2) Clicking the "Last" button on the pagination part of the display sends a NaN (Not A Number) value as the iDisplayStart variable being passed to my Python program. Because of that my Python program isn't sure how to access the data for the page and crashes.
Here's how I'm initializing my datatabes:
[code]
// set up the report table to use the datatables plugin
this.$report_table.dataTable({
"bJQueryUI": true,
"iDisplayLength": 25,
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : mp.base_path + "cshold/apolloData",
"fnServerData" : function(sSource, aoData, fnCallback) {
$.ajax({
"dataType" : "json",
"type" : "POST",
"url" : sSource,
"data" : aoData,
"success" : fnCallback
});
},
"sPaginationType": "full_numbers",
"bAutoWidth": true,
"bScrollCollapse": true,
"aaSorting": [[1, "asc"]],
"aoColumns": [
{"sClass" : "center", "sWidth": "10%"},
{"sClass" : "center reference", "sWidth": "10%"},
{"sClass" : "center order_id", "sWidth": "10%"},
{"sWidth" : "10%"},
{"sClass" : "right", "sWidth": "10%"},
{"sClass" : "center", "sWidth": "3%"},
{"sClass" : "left", "sWidth": "47%"}]
});
[/code]
If anyone has any ideas what I might be doing wrong, or some pointers to help me with this problem, that would be greatly apprecitated.
Thanks in advance!
Doug
I'm using dataTables version 1.8.2 in a Python/Pylons application and using the sAjaxsource property to page the data on the server side. This works really well, but I've got two problems:
1) The "Next" button on the pagination part of the display doesn't do anything, all the other buttons function as I'd expect, rebuilding the table with the data for that page.
2) Clicking the "Last" button on the pagination part of the display sends a NaN (Not A Number) value as the iDisplayStart variable being passed to my Python program. Because of that my Python program isn't sure how to access the data for the page and crashes.
Here's how I'm initializing my datatabes:
[code]
// set up the report table to use the datatables plugin
this.$report_table.dataTable({
"bJQueryUI": true,
"iDisplayLength": 25,
"bProcessing" : true,
"bServerSide" : true,
"sAjaxSource" : mp.base_path + "cshold/apolloData",
"fnServerData" : function(sSource, aoData, fnCallback) {
$.ajax({
"dataType" : "json",
"type" : "POST",
"url" : sSource,
"data" : aoData,
"success" : fnCallback
});
},
"sPaginationType": "full_numbers",
"bAutoWidth": true,
"bScrollCollapse": true,
"aaSorting": [[1, "asc"]],
"aoColumns": [
{"sClass" : "center", "sWidth": "10%"},
{"sClass" : "center reference", "sWidth": "10%"},
{"sClass" : "center order_id", "sWidth": "10%"},
{"sWidth" : "10%"},
{"sClass" : "right", "sWidth": "10%"},
{"sClass" : "center", "sWidth": "3%"},
{"sClass" : "left", "sWidth": "47%"}]
});
[/code]
If anyone has any ideas what I might be doing wrong, or some pointers to help me with this problem, that would be greatly apprecitated.
Thanks in advance!
Doug
This discussion has been closed.
Replies
Allan
I was NOT setting them properly (which falls under the category of DUH!), and in my SqlAlchemy query I wasn't properly calculating the slice value. So a double whammy. Corrected those issues and looks like it's working great!
Thanks for your quick reply and your pointing me in the right direction,
Doug