Using Paging and Server-Side processing, clicking the page button executes no HttpGet requests
Using Paging and Server-Side processing, clicking the page button executes no HttpGet requests
Vish
Posts: 1Questions: 0Answers: 0
I'm using 1.8.2 with paging, filtering, sorting, and server-side processing. Filtering and Sorting work fine - when I perform those actions I can see the appropriate requests in Firefox. However, when I try to page no request is sent to the server. If anyone could provide a solution I'd be very grateful. I spent some time stepping through the dataTables code and found the following:
At line 331, the next button click event is handled. The following call is made: [code]oSettings.oApi._fnPageChange( oSettings, "next" )[/code]. In that function, at line 5134, the value false is returned because in the comparison [code]iOldStart != oSettings._iDisplayStart[/code] both [code]iOldStart[/code] and [code]oSettings._iDisplayStart[/code] are 0. Therefore, in the event handling code, [code]fnCallbackDraw( oSettings );[/code] is never executed (line 333).
Of course, I don't really know the codebase, so none of that could be the reason at all. Here's my initialization code:
[code]
var jAccountPlansDataTable = $('table#account-plans-dataTable'),
sAccountPlanInteractBtnClass = 'account-plan-button';
jAccountPlansDataTable = jAccountPlansDataTable.dataTable({
'bInfo': false,
'bServerSide': true,
'bProcessing': true,
'bPaginate': true,
'bLengthChange': false,
'bAutoWidth': false,
'sAjaxSource': accountPlansDataTableSource,
'aoColumns' : [
{ 'sClass' : sAccountPlanInteractBtnClass,
'sName' : 'Command',
'fnRender': function (param) {
if (param.aData[0] === 'Edit') {
var url = accountPlanIndexUrl + '/' + param.aData[2];
return '' + param.aData[0] + '';
}
else {
var url = createNewAccountPlanUrl + '?clientId=' + param.aData[1];
return '' + param.aData[0] + '';
}
},
'bSortable': false },
{ 'sName': 'ClientId',
'bVisible': false },
{ 'sName': 'AccountPlanId',
'bVisible': false },
{ 'sName': 'Client',
'sWidth': '80%' }
]
});
[/code]
At line 331, the next button click event is handled. The following call is made: [code]oSettings.oApi._fnPageChange( oSettings, "next" )[/code]. In that function, at line 5134, the value false is returned because in the comparison [code]iOldStart != oSettings._iDisplayStart[/code] both [code]iOldStart[/code] and [code]oSettings._iDisplayStart[/code] are 0. Therefore, in the event handling code, [code]fnCallbackDraw( oSettings );[/code] is never executed (line 333).
Of course, I don't really know the codebase, so none of that could be the reason at all. Here's my initialization code:
[code]
var jAccountPlansDataTable = $('table#account-plans-dataTable'),
sAccountPlanInteractBtnClass = 'account-plan-button';
jAccountPlansDataTable = jAccountPlansDataTable.dataTable({
'bInfo': false,
'bServerSide': true,
'bProcessing': true,
'bPaginate': true,
'bLengthChange': false,
'bAutoWidth': false,
'sAjaxSource': accountPlansDataTableSource,
'aoColumns' : [
{ 'sClass' : sAccountPlanInteractBtnClass,
'sName' : 'Command',
'fnRender': function (param) {
if (param.aData[0] === 'Edit') {
var url = accountPlanIndexUrl + '/' + param.aData[2];
return '' + param.aData[0] + '';
}
else {
var url = createNewAccountPlanUrl + '?clientId=' + param.aData[1];
return '' + param.aData[0] + '';
}
},
'bSortable': false },
{ 'sName': 'ClientId',
'bVisible': false },
{ 'sName': 'AccountPlanId',
'bVisible': false },
{ 'sName': 'Client',
'sWidth': '80%' }
]
});
[/code]
This discussion has been closed.