I want to click on a row and that take me to a detail screen.

I want to click on a row and that take me to a detail screen.

achalkachalk Posts: 4Questions: 2Answers: 0

I have a DataTable and I want a click anywhere in a row and be taken to another page. I.e. the whole row is a button (so to speak). How do I accomplish this? Many thanks.

Right now my DataTable code looks fairly ordinary:
<tbody>
{% if exhibits %}
{% for exhibit in exhibits %}
<tr>
<td>{{ exhibit.title }}</td>
<td>{{ exhibit.author }}</td>
<td>{{ exhibit.country }}</td>
<td>{{ exhibit.create_date }}</td>
<td>{{ exhibit.description }}</td>
<td>{{ exhibit.value | intcomma }}</td>
<td>{{ exhibit.curator }}</td>
</tr>
{% endfor %}
{% else %}
<div class="col-md-12">
<p>No listings available</p>
</div>
{% endif %}
</tbody>

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    See this example here, it's doing that,

    Colin

  • achalkachalk Posts: 4Questions: 2Answers: 0

    Thanks, that works! And sorry for the slow reply. I got pulled onto something else.

    Best,

    • A
This discussion has been closed.