I've been requested to show a wait message while paging as paging with numerous columns in IE is a bit slow. Anyway to do this? I could attach an event to the buttons to show a message, just need an event to hide it.
Can you give me a link please? It appears to work just fine in this example: http://datatables.net/release-datatables/examples/data_sources/server_side.html
Fair enough, but I'm afraid I can't offer any help then. As I noted, the link I gave above shows it working as I would expect, so I would need a way to be able to reproduce the problem to even stand a chance of fixing it :-)
Yeah I do the same thing In my app and bProcessing works fine for initial page load and pagination events, really didn't do anything at all, just set bProcessing to true and configure my sDom option to show the label where I want it to show e.g "sDom" : '<"H"flrp>t<"F"i>'
I know it's useless not being able to post the site. i added the r to the sDom and it doesn't make any difference. Here is my table definition for what it's worth. Thanks for the help.
You've got two 'r's in your sDom now, which you probably don't want. However, all I can suggest is that you add a little bit of debugging to _fnProcessing inside DataTables to see if the function is being called correctly.
Replies
Allan
Allan
[code]
var oTable = jQuery('#siteDetail').dataTable( {
"bProcessing": true,
"bServerSide": false,
"sAjaxSource": 'View/Data/DetailDataSite.cfc?method=getdetaildata_json',
"bAutoWidth": false,
"bFilter": true,
"bInfo": true,
"bJQueryUI": false,
"bPaginate": true,
"bFilter": false,
"sPaginationType": "four_button",
"bSort": false,
"iDisplayLength": 25,
"aLengthMenu": [[25, 50, 75, 100], [25, 50, 75, 100]],
"bDeferRender": true,
"sDom": '<"top"lfrip<"clear">>rt<"bottom"<"#spacer">ip<"clear">>',
"oLanguage": {
"sLoadingRecords": "Please wait - loading...",
"sEmptyTable": "Please wait - loading...",
"sZeroRecords": "Please wait - loading..."
},
"aoColumns": objCols.aaData,
fnServerData: function ( sSource, aoData, fnDraw ) {
for (i=1; i<=12; i++){
prevPage = i-2;
if(i > 1){
params = params.replace('PAGENUM=' + prevPage, 'PAGENUM=' + i);
if (i == 2){
params = params.replace('PAGESIZE=25', 'PAGESIZE=75');
params = params.replace('PAGENUM=1', 'PAGENUM=2');
}else if(i >= 3){
params = params.replace('PAGESIZE=75', 'PAGESIZE=100');
params = params.replace('PAGENUM=' + prevPage, 'PAGENUM=' + prevPage);
}
}
jQuery.ajax({
error: function(XMLHttpRequest, textStatus, errorThrown){alert(errorThrown)},
"dataType": "json",
"type": "POST",
"url": 'View/Data/DetailDataSite.cfc?method=getdetaildata_json',
"data": params,
"success": function(resp){
if(resp.iTotalRecords > 0){
if(i == 1){
fnDraw(resp);
}else{
setTimeout(function(){fnDraw(resp)}, 500)
}
}
if (resp.sEcho == 12){
setTimeout(function(){oTable.fnSort( [ [ colSort , sortAD ] ] );}, 1000)
}
}
});
}
}
});
[/code]
Allan