How do i implement child rows using Thymeleaf Template Engine?

How do i implement child rows using Thymeleaf Template Engine?

FanitanyFanitany Posts: 3Questions: 3Answers: 0

Hello,

I am currently making a page containing a table with jobs. I do this using datatables in combination with thymeleaf.

At the moment i'm having trouble getting the child rows to work for this table. The problem is that when i use the format function (https://datatables.net/examples/api/row_details.html) i need to return the html for the child row, except it has to contain a variable like this:

<td th:text="${e.Example}"></td>

But this obviously won't work since the variable can't be defined in the .js file, but i can't seem to find a way to get it working.

Thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,831Questions: 1Answers: 10,518 Site admin
    Answer ✓

    I can't help with the ThymeLeaf aspect of this I'm afraid - I've never used it! All I can really say is that you need to pass the data that you want to display in the child row into the row().child() method like in the demo.

    Allan

This discussion has been closed.