Processing Events

Processing Events

PaulusPaulus Posts: 69Questions: 17Answers: 5

I am using the following to receive the processing event, without any success. I have tried both with and without .dataTable() ending but the result is the same - It is only called with the parameter processing == false.
I have also tried to set the DataTable option.processing to true without success. I wish to display a custom animation, any help.

            $('#myTable').on('processing.dt', function (e, settings, processing) {
                if (processing) {
                    console.log('it is loadding');     // **I do not get this**
                } else {
                    console.log('it is not loadding'); // **I get this**
                }
            });


            $('#myTable').on('processing.dt', function (e, settings, processing) {
                if (processing) {
                    console.log('it is loadding');     // **I do not get this**
                } else {
                    console.log('it is not loadding'); // **I get this**
                }
            }).dataTable();

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,106Questions: 1Answers: 10,394 Site admin

    That looks like it should work, and it does appear to here: http://live.datatables.net/zojofico/1/edit .

    I'd need a link to a test case showing the issue.

    Allan

  • PaulusPaulus Posts: 69Questions: 17Answers: 5

    Hello Allan,

    It seems your sample is not working either. Check the console pane to see if any message is displayed (tried it with both Chrome and Firefox).

  • allanallan Posts: 63,106Questions: 1Answers: 10,394 Site admin

    Looks okay to me. Chrome Mac.

    Allan

    test.png 130.4K
  • PaulusPaulus Posts: 69Questions: 17Answers: 5
    edited December 2016

    Now, this is frustrating. Tried IE11, Opera 42 on Win7 refreshed/run etc and still no message. Downloaded the file and run locally, still there is no message.

    I inserted console.log statement before the table, and it is displayed.

  • allanallan Posts: 63,106Questions: 1Answers: 10,394 Site admin

    How are you trying to make the table do any processing? Click to sort and it should show the logging messages.

    Allan

  • PaulusPaulus Posts: 69Questions: 17Answers: 5

    OK, I get it.
    So it means the event is not sent when the table is first loading the data?
    That is the level I am looking for, replace the current default progressing message display with an animation (not GIF).

  • allanallan Posts: 63,106Questions: 1Answers: 10,394 Site admin
    Answer ✓

    It would be, but currently the event listener is being attached after the event has already happened when the table was initialised. You'd need to listen for it before the table initialisation if you want to get the event during the initialisation.

    Allan

This discussion has been closed.