override processing indicator

override processing indicator

periklisperiklis Posts: 13Questions: 0Answers: 0
edited February 2012 in General
Hello,
is there a way to completely override the processing indicator? I have a general processing indicator which I use in my site, and I would like my datatables instances to call this upon ajax start/finish loading.
Thanks in advance

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Yes indeed there is :-). In 1.9 what you can do is listen for the "processing" event from DataTables and show / hide your own processing indicator based on that: http://datatables.net/docs/DataTables/1.9.beta.3/#processing . Then simply drop the "r" option from sDom (which means DataTables won't add the HTML needed for its processing indicator) and that's that :-)

    Allan
  • periklisperiklis Posts: 13Questions: 0Answers: 0
    Hey thanks, that was just what I was looking for! (I also had to upgrade to 1.9, all working smooth! )
    For anyone interested here's how I implemented it:
    [code]
    $('#table_id').dataTable().bind('processing',
    function (e, oSettings, bShow) {
    if (bShow) {
    show_my_ajax_indicator();
    } else {
    hide_my_ajax_indicator();
    }
    });
    [/code]
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Excellent - good to hear that did the job for you and thanks for sharing your solution with us :-)

    Allan
This discussion has been closed.