Show processing when table.ajax.reload()?

Show processing when table.ajax.reload()?

rocking80rocking80 Posts: 1Questions: 1Answers: 0

I found when create the datatable first time, it can show "Processing" indicator by adding "processing: true" flag.
But when to refresh the data by " table.ajax.reload()", the indicator will not show?
Anyone knows how to show it when call ajax.reload? Many thanks.

Answers

  • Dalex73Dalex73 Posts: 30Questions: 4Answers: 4

    You can "build" your own processing function using,

    $('#example').on('preXhr.dt', function (e, settings, data) {
     console.log('ajax start');
    })
    
    $('#example').on('xhr.dt', function (e, settings, json, xhr) {
            console.log('ajax end');
        })
    

    I use the jQuery BlockUI Plugin (http://malsup.com/jquery/block/) inside the functions and that works very well and looks good. Doing it like this works for initial ajax load and reloads.

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin

    But when to refresh the data by " table.ajax.reload()", the indicator will not show?

    It should do! Can you link to a page showing the issue please?

    Thanks,
    Allan

  • worgorworgor Posts: 17Questions: 4Answers: 0

    i've got the same issue when using pTable.ajax.reload(filterrefresh(),false), the processing indicator does not show up! any clue about that?

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin

    Happy to take a look at a test case showing the issue.

    Allan

This discussion has been closed.