I'm currently utilizing ng-table to construct my table. I have a button positioned at the top of the table that is initially disabled. My goal is to enable this button only when any of the checkboxes are selected. The button should automatically disable itself if no checkboxes are checked. Can someone provide guidance on how to achieve this functionality effectively?
Here is a snippet of my code:
HTML
<button class="btn btn-default pull-right" disabled >Remove Selected</button>
<table ng-table="tableParams" show-filter="true" class="table ng-table-responsive">
<tr ng-repeat="user in $data" ng-class="{ 'emphasis': user.money > 500 }">
<td width="30" style="text-align: left" header="'ng-table/headers/checkbox.html'">
<input type="checkbox" ng-model="checkboxes.items[user.id]" />
</td>
<td data-title="'Name'" filter="{ 'name': 'select' }" filter-data="names($column)">
{{user.name}}
</td>
<td data-title="'Money'" sortable="'money'">
{{user.money}}
</td>
</tr>
</table>
<script type="text/ng-template" id="ng-table/headers/checkbox.html">
<input type="checkbox" ng-model="checkboxes.checked" id="select_all" name="filter-checkbox" value="" />
</script>
JS
var app = angular.module('main', ['ngTable']).
controller('DemoCtrl', function($scope, $filter, $q, NgTableParams) {
// Angular controller logic goes here, omitted for brevity
})
Any helpful input would be greatly appreciated.