ajax.url().load with processing:true won't show "Loading ..." message

ajax.url().load with processing:true won't show "Loading ..." message

jfrjfr Posts: 71Questions: 24Answers: 0
edited March 2016 in DataTables 1.10

Hi
I have added a fonction witch need to clear and load new data from server
I was hoping DataTables to get the "Loading ..." message that I get when refresh or load the table for the first time I get nothing.

first i tried
oTable.clear().draw();
witch display "No data available in table"
and then I do
oTable.ajax.url("../link?parm1=1&parm2=2").load();
"No data available in table" will not change to "Loading ..." until the data is all process

I remove the
oTable.clear().draw();
then screen wont change until the data is all process

debug code is owabuv

Thanks in advance

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin

    As the documentation for language.loadingRecords notes (emphasis added):

    When using Ajax sourced data and during the first draw when DataTables is gathering the data, this message is shown in an empty row

    There is no way to use the language.loadingRecords option after the first draw. You could consider using processing to show a processing indicator.

    Allan

  • jfrjfr Posts: 71Questions: 24Answers: 0

    Hi Allan

    I did not repeated it from the title but I'm using the processing : true
    And i did tried different thing before asking for help
    1) The load() does not change clear or display a message of loading
    2) The clear().load() give No data available after clearing the table and does not change for loading

    Is there a way to clear the table and displaying the loading message ?

    Thanks in advance

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Is there a way to clear the table and displaying the loading message ?

    No - as I said, there is no option to show the "Loading..." text other than at the first draw. The "Processing" text is designed to cover that need. If you need the original Loading message to show, you would need to modify DataTables, which you are of course free to do since it is open source.

    Allan

This discussion has been closed.