0
我有这样的代码流星onrendered使用jQuery的时候做的工作每个
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');
});
});
,这是模板
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>
上面迭代的代码表,并做一些事情与数据非常有用,从表行,即id在每个td。
我想知道为什么这个代码alert('this rendered inside each');
永远不会触发。