【发布时间】:2014-04-10 14:06:17
【问题描述】:
在我的流星应用程序中,我有下表,它包含在数据表中):
<template name="IntroductionWizard_Step_2">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Introduction Wizard Step 2: </h3>
<h3>Select an Application to describe</h3>
</div>
<table class="table table-hover table-bordered" id="apptable">
<thead>
<tr>
<th>App ID</th>
<th>App Name</th>
<th>In Scope</th>
<th>App Owner</th>
<th>BU</th>
</tr>
</thead>
<tbody>
{{#each appList}}
{{>appRow}}
{{/each}}
</tbody>
</table>
<br />
</div>
<br/>
</div>
</div>
</div>
</template>
<template name="appRow">
<tr>
<td>{{AppId}} </td>
<td>{{AppName}} </td>
<td>{{InScope}} </td>
<td>{{AppOwner}}</td>
<td>{{Bu}}</td>
</tr>
</template>
这是这个数据表的处理程序:
Template.IntroductionWizard_Step_2.rendered = function(){
console.log('wizard.js: IntroductionWizard_Step_2 is rendered');
/* Init the table */
oTable = $('#apptable').dataTable( );
$("#apptable tbody tr").on('click',function(event) {
$("#apptable tbody tr").removeClass('row_selected');
$(this).addClass('row_selected');
});
}
我的问题是:如何捕获选定/点击的表格行的值?
【问题讨论】:
标签: jquery meteor datatables