Rerendering issue since v2

Rerendering issue since v2

paulfpaulf Posts: 5Questions: 0Answers: 0

Hi, since updating to v2 we're unable to re-render a DataTable using the following code:

this.dtElement.dtInstance.then((dtInstance: Api): void => {
    dtInstance.destroy();
    this.dtTrigger.next(this.dtOptions);
});

Should this still be supported or is there another approach?

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin

    What is this.dtTrigger.next?

    Can you create a test case showing the issue please?

    Allan

  • paulfpaulf Posts: 5Questions: 0Answers: 0

    Thanks, is there a template for creating a test case?

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin

    https://live.datatables.net will get you a basic starting point.

    If you are using Vue (which you might be at a guess?) you could use this example as a starting point.

    Allan

  • paulfpaulf Posts: 5Questions: 0Answers: 0
    edited May 14

    Using Angular, thanks I'll get a test case made.

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin

    Are you using Angular DataTables like in this thread as well? If so, you'll need to ask the Angular DataTables dev. It isn't something I've worked with myself.

    Allan

  • paulfpaulf Posts: 5Questions: 0Answers: 0

    I am, after fixing initial issues with pagination he directed me here.

    https://github.com/l-lin/angular-datatables/issues/1785

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin

    It isn't clear to me that it is a DataTables error, since I can readily destroy and recreate a table: https://live.datatables.net/povatuge/1/edit . I'd need a test case showing the issue to be able to understand what is happening.

    Allan

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

    I would look for errors in the browser's console.

    Do the Datatables options change? Guessing this.dtOptions are the options.

    If the columns change you might need to empty the table as shown in one of the examples in the docs.

    If this doesn't help then the test case Allan asked for is needed for us to help debug.

    Kevin

  • paulfpaulf Posts: 5Questions: 0Answers: 0

    Thanks

Sign In or Register to comment.