Create and handle editors in child tables

Create and handle editors in child tables

toni.petrovictoni.petrovic Posts: 8Questions: 4Answers: 0

Hi,

My question is linked to the blog: https://datatables.net/blog/2019-01-11.

The question is about child editor function - usersEditor. How do you link the reference table to the usersEditor, if you expand more than one row? In the example is shown as table: table, but you can create more than one table. Should this usersEditor be created inside the createChild function?

Hope I made it clear enough.

Thank you and kind regards,
Toni

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Answer ✓

    Should this usersEditor be created inside the createChild function?

    Yes it should be, and it is if you look at the final code - line 12 specifically.

    table inside createChild is locally scoped (the DOM table, DataTable API and Editor all are) which is how it is possible to have multiple rows open at the same time, each with their own DataTable and Editor instances.

    Apologies if that doesn't come across in the blog post.

    Allan

  • toni.petrovictoni.petrovic Posts: 8Questions: 4Answers: 0

    Dear @allan,

    thank you for your answer.

    Kind regards,
    Toni

Sign In or Register to comment.