Catch end of rendering large records datatable

Catch end of rendering large records datatable

gandalf_chgandalf_ch Posts: 2Questions: 2Answers: 0

Hi all, I'm loading lot of data (20'000 records) in my datatable. I can't change this for now, I will probably move to an ajax loading data or something similar later but for now I must provide a first version like this.
I've a spinned which let user wait while the datatable loads. Unfortunately the jquery "document.ready" function arrives before the datatable finishes the formatting: I mean I see the datatable with a lot of records on the screen and after 4-5 seconds I see the datatable search, the pagination and so on. So I guess the datatable rendering isn't finished yet when document.ready arrives. So my question is: It's there any possibility to wait until the datatable is completely rendered before throwing the document.ready or remove the spinner (any datatable.ready() function) ? It looks like the datatable rendering is asynchronous (I'm not a JQuery/Javascript expert...).

Thank you for your help.

Answers

  • kthorngrenkthorngren Posts: 21,345Questions: 26Answers: 4,954

    Datatable doesn't control when the document ready event is fired. You can use initComplete to turn off the spinner when Datatables initialization is complete.

    Kevin

Sign In or Register to comment.