[英]How to Edit users list using `meteorJs`?
我需要開發meteorjs應用程序 ,因此我需要幫助,因為我想編輯客戶端行{{cid}}的值,但是它不起作用。這是我的代碼,請驗證,我在哪里錯誤建議我。
clientJs:
//Edit client info
Template.client.events({
'click .clientrow':function(e,t){
console.log("You Edit Client Row");
e.preventDefault();
alert(tmpl.data._id);
}
});
my template:
<table class="table table-bordered tablestriped table-hover">
<thead>
<tr>
<th>Client Id</th>
<th>Medical RNO</th>
<th>Client</th>
<th>Referral Date</th>
<th>Referred By</th>
<th>Clinician</th>
<th>Service</th>
<th>Episode</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{{#each clientList}}
<tr class="clientrow">
<td>{{cid}}</td>
<td>{{mrno}}</td>
<td>{{client}}</td>
<td>{{formatDate rdate}}</td>
<td>{{referredby}}</td>
<td>{{clinecian}}</td>
<td>{{serviece}}</td>
<td>{{episode}}</td>
<td>{{actions}}</td>
</tr>
{{/each}}
</tbody>
</table>
我很累,所以這可能需要一些調整,但是
var cid = $(t).find('td:first')。text();
要么
var cid = $('td:first',$(t).parents('tr'))。text();
要么
var cid = $('td:first',$(t))。text();
要么
Template.client.events({'click .clientrow':function(e,t){
e.preventDefault();
console.log("You Select Client Row " + this.client);
alert(this.mrno + ' ' + this.client);
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.