angularjs点击⾏选中radio单选按钮
给input单选框添加value值和ng-model绑定,保证value属性值和绑定的值⼀致⾃然就能选中
HTML代码
<table ng-table="tableParams" class="table ng-table-responsive">
<thead class="tableThead">
<th><input type="radio" disabled></th>
<th>版本号</th>
<th>临时版本号</th>
<th>创建⼈</th>
<th>创建时间</th>
</thead>
<tbody>
<tr ng-repeat="item in historyMsg" class="tableTdV" ng-click="rowClick(item.ID)" ng-class='{focus: item.ID==focus}'>
<th><input type="radio" name="radioType" id="{{item.ID}}" value="{{item.ID}}" ng-model="focus"></th>
<td>
{{item.VersionNumber}}
</td>
<td>
{{item.TempVersionNumber}}
</td>
<td>
{{item.Creators}}
</td>
<td>
{{item.CreateDate}}
</td>
</tr>
</tbody>
html radio点击变颜<tfoot>
<tr >
<td class="text-success text-right" colspan="12"><strong>共{{al()}}条记录,共 {{totalPages}}页</strong></td> </tr>
<tr>
<td class="text-success text-center" colspan="12">
<button type="submit" class="btn alertBtn" ng-click="delete()" >删除</button>
<button type="submit" class="btn alertBtn" ng-click="Closed();" >确定</button>
</td>
</tr>
</tfoot>
</table>
JS 代码
//点击选中⾏
$wClick = function (id) {
$scope.focus = id;
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论