I have in java this two objects:
Person.java
public class Person {
String name;
String surname;
List<PersonDetails> details;
//Constructor and getter-setter methods
...
}
PersonDetails.java
public class PersonDetails {
int age;
String city;
//Constructor and getter-setter methods
...
}
I create a list of Person Object and I put it into the session.
Front-end side I create a table where I display the list:
<table id="myTable">
<thead>
<tr>
<th>Detail</th> <!-- this is a button -->
<th>Name</th>
<th>Surname</th>
</tr>
</thead>
<tbody>
<tr th:each=" p : ${listPerson}">
<td></td>
<td>${p.name}</td>
<td>${p.surname}</td>
</tr>
</tbody>
Like you can see there is no trace of the details list for each p in the table. Because, I would that, when I click on the detail button, a new table containing details list was appended to that row (p).
Like this:
(source: falafel.com)
I'm not asking you to produce the code, I'm asking some ideas to do this. There is any plugin for this case?