#71 Clickable Row with Ember Models Table

Emad Ibrahim
Sep 6, 2016 · 1 min read

Guest Tip by Mehrdad Rafiee
If you are using Ember Models Table and you need to change the route (change URL) once you click on a row, you can pass “rowTemplate” attribute to the table component and in the template pass the attribute tagName=”tr” to the link-to helper like so:

app/templates/index.hbs

{{models-table data=data rowTemplate="ember-models-table/band-row"}}

app/templates/band-row.hbs

{{#link-to "bands.band.song" record.id tagName="tr"}}
<td>{{record.songName}}</td>
<td>{{record.songDetails}}
<span class="fa fa-chevron-right pull-right"></span>
</td>
{{/link-to}}

Originally published at Ember Daily Tips.

Emad Ibrahim

Written by

Husband, Father of Twins, Published Author, Entrepreneur, Passionate Technologist, Programmer and Productivity Nut. more at https://about.me/eibrahim