【发布时间】:2014-05-27 23:40:04
【问题描述】:
我正在使用带有引导程序的 ember js 我有一张使用引导程序的表
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Request Id</th>
<th>Applied By</th>
<th>Leave Type</th>
<th>Leave From</th>
<th>Leave To</th>
<th>Days</th>
<th>Status</th>
<th>Applied date</th>
<th>Applied/Declined date</th>
</tr>
</thead>
<tbody data-link="row" class="rowlink">
{{#each model.pending}}
<tr id="ptable" data-toggle="modal" data-target="#pendingrequestsmodal" style="cursor: pointer">
<td id="eid">{{id}}</td>
<td>{{employee_id}}</td>
<td>{{type_id}}</td>
<td>{{from_date}}</td>
<td>{{to_date}}</td>
<td>{{days}}</td>
<td>{{status}}</td>
<td>{{to_date}}</td>
<td>{{to_date}}</td>
</tr>
{{/each}}
</tbody>
</table>
现在当有人点击表格行时,我会显示引导模式以进行确认
<div id="pendingrequestsmodal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
<button type="button" class="btn btn-default" data-dismiss="modal">Decline</button>
<button type="button" class="btn btn-primary" {{action "pendingAction" target="controller" }}>Approve</button>
</div>
</div>
</div>
我想要这些点击的行详细信息在 ember 中,以便我可以在服务器上处理它
App.ApprovalrequestsController = Ember.ObjectController.extend({
actions: {
pendingAction: function () {
//here i want to get the details of clicked row
//this.transitionToRoute("approvalrequests", rdata);
}
}
});
谁能告诉我如何在 ember 中获取点击的行详细信息
【问题讨论】:
标签: jquery twitter-bootstrap ember.js ember-data bootstrap-modal