Individual DataTables Editor sub-table within each row of parent

Individual DataTables Editor sub-table within each row of parent

maliwikmaliwik Posts: 55Questions: 5Answers: 1

This perhaps might be pushing the limits of what might be practical for JavaScript in general.

Let's say you have a parent table called Users that lists all the users on your site. This has generic information like address, e-mail, etc. that may be edited. When you click on a cell that has a plus icon, it opens up a sub-table underneath this user's row that has a list of reports associated with the user. Each report can then be modified independently with Editor and submitted without affecting the parent table (or at least allowing for updating the parent User's Date Modified column).

I've been looking through the documentation in both DataTables and Editor as well as the forums and haven't been able to find anything that might describe how to achieve this.

Is this possible with DataTables and Editor or would there need to be some serious extended JS logic to accompany it?

Replies

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    Yup - absolutely you can do that. This blog post will hopefully be a useful starting point.

    You basically need to combine that with the child row show / hide example (i.e. instead of putting the child information in a second always visible table - put it into the child row).

    Allan

  • maliwikmaliwik Posts: 55Questions: 5Answers: 1
    edited September 2017

    Thanks Allan!

    I was hoping I could insert the table as kind of a sub-row by clicking on the parent row but I used your blog post and it works perfectly for what I need :smile:

This discussion has been closed.