Show wait message while paging

Show wait message while paging

LesGLesG Posts: 14Questions: 0Answers: 0
edited August 2012 in General
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.

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    edited August 2012
    I'd say bProcessing is what I think you want :-)

    Allan
  • LesGLesG Posts: 14Questions: 0Answers: 0
    Tried that, no message while paging :-(
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    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
  • LesGLesG Posts: 14Questions: 0Answers: 0
    I can't disclose the app as it's secured. I get the message while loading but not while paging with bProcessing set to true.
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    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 :-)

    Allan
  • MichaelPineMichaelPine Posts: 7Questions: 0Answers: 0
    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>'
  • LesGLesG Posts: 14Questions: 0Answers: 0
    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.

    [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]
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    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.

    Allan
  • MichaelPineMichaelPine Posts: 7Questions: 0Answers: 0
    Hmmm I actually have ServerSide set to True, I don't use fnServerData, could it be something to do with that difference ?
This discussion has been closed.