I’m using DataTables to make my tables more spiffy.
In my controller code, when a record is saved, I attach a whole new row to the table using it’s public facing API.
// This is inside the controller code.
// https://datatables.net/reference/api/row.add()
MyEmberApp.UsersDataTable.row.add([
user.get('id'),
user.get('last_name'),
user.get('first_name'),
user.get('email'),
(self.get('company')).get('name'),
user.get('role'),
'<button class="btn btn-default"><i class="fa fa-user"></i></button>',
'<button class="btn btn-default"><i class="fa fa-pencil"></i></button>'
]).draw();
And this works fine and renders the button, except for the lacking action
wired into it.
Heres what I use in my template:
{{#each}}
<td><button class="btn btn-default" {{action 'createUserModal' this}}><i class="fa fa-pencil"></i></button></td>
{{/each}}
How can I generated a properly wired up button inside my controller?