fnDraw() not working correctly.
fnDraw() not working correctly.
Hi!
I have a problem with refreshing my results after doing certain action. I created a select and I want to refresh table with new info after select is changed. I overridden fnServerData to fire my method which adds some data to request. My version is 1.9.4. My code:
[code]
table.dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": process_ajax,
"fnServerData": function(sSource, aoData, refreshCallback){
checkDateRange(aoData);
fnDataTablesPipeline(sSource,aoData,refreshCallback);
},
"bInfo":false,
aoColumns:[
{mData:'id',"bSortable":false},
{mData: 'keyword',"bSortable":false},
{mData:'searched_at',"bSortable":true},
{mData:'rows_returned',"bSortable":true},
{mData:'page_number',"bSortable":true},
],
"aaSorting": [[2,'desc']],
"bDeferRender":true,
});
[/code]
and function
[code]
function checkDateRange(aoData){
if(dateRange.range !== 0){
var range = {mode: dateRange.mode};
if(dateRange.range == 3){
range.start = dateRange.start;
range.end = dateRange.end;
}
aoData.push({dateRange: range});
}
}
[/code]
The problem is that fnDraw() is silently firing and doing nothing. No errors, no call to server. But I get log from console.log placed after fnDraw(). Honestly I have no idea what is going :) Any ideas ?
I have a problem with refreshing my results after doing certain action. I created a select and I want to refresh table with new info after select is changed. I overridden fnServerData to fire my method which adds some data to request. My version is 1.9.4. My code:
[code]
table.dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": process_ajax,
"fnServerData": function(sSource, aoData, refreshCallback){
checkDateRange(aoData);
fnDataTablesPipeline(sSource,aoData,refreshCallback);
},
"bInfo":false,
aoColumns:[
{mData:'id',"bSortable":false},
{mData: 'keyword',"bSortable":false},
{mData:'searched_at',"bSortable":true},
{mData:'rows_returned',"bSortable":true},
{mData:'page_number',"bSortable":true},
],
"aaSorting": [[2,'desc']],
"bDeferRender":true,
});
[/code]
and function
[code]
function checkDateRange(aoData){
if(dateRange.range !== 0){
var range = {mode: dateRange.mode};
if(dateRange.range == 3){
range.start = dateRange.start;
range.end = dateRange.end;
}
aoData.push({dateRange: range});
}
}
[/code]
The problem is that fnDraw() is silently firing and doing nothing. No errors, no call to server. But I get log from console.log placed after fnDraw(). Honestly I have no idea what is going :) Any ideas ?
This discussion has been closed.
Replies
Allan