retrieve to avoid destroying first...

retrieve to avoid destroying first...

GearTheWorldGearTheWorld Posts: 11Questions: 2Answers: 0

Link to test case:
No link. It's a suggestion

Debugger code (debug.datatables.net):
No debugger code. It's a suggestion

Error messages shown:
No error messages. It's a suggestion

Description of problem:
When using retrieve to avoid destroying we still need to get into the initComplete but with retrieve it doesn't get there. Either you make sure to trigger the initComplete event with retrieve OR you give us a new event in which we have to perform things after the table is initialized despite not being initialized again using retrieve. Something like retrieveComplete maybe ?

Replies

  • kthorngrenkthorngren Posts: 21,445Questions: 26Answers: 4,974
    edited April 2022

    It would be helpful to understand when you are doing when retrieve is being used. Also what is your initComplete function doing that needs executed again.

    Maybe you can use DataTable.isDataTable() in if the Datatable exists create a one time draw event, using .one() not .on() that will execute after the Datatable is retrieved using the retrieve option. Copy your initComplete code into the one time event.

    If you still need help please post your relevant code so we can see what you are doing.

    Kevin

  • GearTheWorldGearTheWorld Posts: 11Questions: 2Answers: 0
    edited April 2022

    Hi kthorngren,

    Thank you, I'll give it a try.

  • GearTheWorldGearTheWorld Posts: 11Questions: 2Answers: 0

    Well I had a bad design after all. Now I initialize the datatable in the main view and remove my busy indicator in the return of the partial view with the data like this :

    $('#EmailLogsTableDetail').html(Result.ViewResult.View).promise().done(function () {
        $('#BusyIndicator').fadeOut();
    });
    
Sign In or Register to comment.