loading ajax source twice?
loading ajax source twice?
bill.martino
Posts: 38Questions: 0Answers: 0
For some reason data tables is loading my ajax source twice for each page call. I have gone through and eliminated any other function calls on page load, but cannot stop the ajax source from loading twice, so have deduced that data tables must be doing it. Here is my initialization code, anyone have any ideas?
[code]
// data table
var oTable = $('#resultTable').dataTable({
"fnServerData": function ( sSource, aoData, fnCallback ) {
// get filter ID
var filter_id = $('#storedFilter_id').val();
// send filter ID
aoData.push(
{ "name": "filter_id", "value": $.trim(filter_id) }
);
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
},
"sAjaxSource": "ajax_urls.cfm",
"aLengthMenu": [100,200,500],
"iDisplayLength": 200,
"sPaginationType": "full_numbers",
"sScrollY": 400,
"sScrollX": "100%",
"bProcessing": true,
"bStateSave": false,
"bServerSide": true,
"bSortClasses": false,
"sDom": 'R<"top"il<"showHide">><"pMid"p>rt<"clear">' ,
"oColReorder": {
"iFixedColumns": 1
}
});
[/code]
[code]
// data table
var oTable = $('#resultTable').dataTable({
"fnServerData": function ( sSource, aoData, fnCallback ) {
// get filter ID
var filter_id = $('#storedFilter_id').val();
// send filter ID
aoData.push(
{ "name": "filter_id", "value": $.trim(filter_id) }
);
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
},
"sAjaxSource": "ajax_urls.cfm",
"aLengthMenu": [100,200,500],
"iDisplayLength": 200,
"sPaginationType": "full_numbers",
"sScrollY": 400,
"sScrollX": "100%",
"bProcessing": true,
"bStateSave": false,
"bServerSide": true,
"bSortClasses": false,
"sDom": 'R<"top"il<"showHide">><"pMid"p>rt<"clear">' ,
"oColReorder": {
"iFixedColumns": 1
}
});
[/code]
This discussion has been closed.
Replies
Allan
[code]
oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aoData,
function(json) {
alert('go');
_fnAjaxUpdateDraw( oSettings, json );
} );
[/code]
Allan
Quite an odd problem, eh?
I removed the column reordering altogether as it wasn't working well for my purposes, and that did not make a difference.
Allan