I have this code
Template.drone.onRendered(function () {
var userid = Meteor.userId();
$('.table > tbody > tr').each(function() {
var friendid = $(this).find("td:first").html();
var userid = Meteor.userId();
alert('this rendered inside each');
});
});
and this is the template
Template name="drone">
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Names</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{{#each allusers }}
<tr>
<td class="buttonId">{{_id}}</td>
<td>{{profile.name}}</td>
<td class="buttonAction">hi</td>
</tr>
{{/each}}
</tbody>
</table>
</template>
The code above iterates a table and does something useful with the data from the table row,i.e id in each td.
I am wondering why this code alert('this rendered inside each');
never fires.