Varied data in child rows

Varied data in child rows

AquaJewAquaJew Posts: 3Questions: 2Answers: 0

I'm looking at this example: https://datatables.net/examples/api/row_details.html

I have some great use cases for this, but there are times when the information that would be in the child rows would be different. For example, one row would contain "value" and an "email" child rows, where another could have "name", "package", and "category" child rows.

Is there a way to set something like this up? I couldn't find the question asked in the forums elsewhere.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,310Questions: 26Answers: 4,771

    You are in control of how the child detail data is presented. The example uses a function called format() which is used to format the output of the child data. It can be a table or whatever you want it to be.

    Kevin

  • AquaJewAquaJew Posts: 3Questions: 2Answers: 0

    Awesome. So what that suggests to me is that in a child row, I could even have an HTML table with column headers and data?

    What I'm trying to do is have a list of daily events, and if I click on one, the nested data is a table displaying a schedule of that event. Here's a visual example:

    • Event Name | Event Date | Duration |
      -- First Activity Time | Activity Name | Mentor | Participant Count
      -- Second Activity Time | Activity Name | Mentor | Participant Count
      -- Third Activity Time | Activity Name | Mentor | Participant Count
    • Event Name | Event Date | Duration |
      -- First Activity Time | Activity Name | Mentor | Participant Count
      -- Second Activity Time | Activity Name | Mentor | Participant Count
      -- Third Activity Time | Activity Name | Mentor | Participant Count

    Does this make sense?

  • kthorngrenkthorngren Posts: 20,310Questions: 26Answers: 4,771
    Answer ✓

    If you can access that data you can display it in any format you want. The child detail data can be displayed as a Datatable if you want. There are examples of this posted in the forum.

    Kevin

This discussion has been closed.