Prevent new callback until server has responded

Prevent new callback until server has responded

errorkneeserrorknees Posts: 10Questions: 0Answers: 0
edited June 2013 in General
I have set up a custom "processing" indicator like this:

[code]
var grid = $('#grid').dataTable({
"fnServerData": function (sSource, aoData, fnCallback) {
showLoader();
etc etc.
},
"fnDrawCallback": function (oSettings) {
hideLoader();
}
[/code]

How do I prevent the user from performing any actions on the DataTable until it has been redrawn? Is there a built-in way to do this or do I need to add my own code that will 'return false;' on any click until the DataTable is ready for a new action..

Replies

  • allanallan Posts: 63,515Questions: 1Answers: 10,472 Site admin
    Yup - you need to add some code to handle it. Putting a position:fixed element over the whole page should do it. You could even use the built in processing element to do that thinking about it.

    Allan
  • errorkneeserrorknees Posts: 10Questions: 0Answers: 0
    I tried wrapping my DataTables table in a div but it's not working..

    [code]
    $(document).ready(function () {
    $('#wrapper').click(function (e) {
    return false;
    });
    });
    [/code]

    How could I use the built-in processing element?
  • errorkneeserrorknees Posts: 10Questions: 0Answers: 0
    blockui. is nice. problem solved.
This discussion has been closed.