Skip to content

Commit

Permalink
Don't enable delete button until some are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronk committed Sep 3, 2024
1 parent 09c8e95 commit 7d57697
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions coldfront/plugins/ifx/templates/plugins/ifx/billing_records.html
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
alert(status + ' ' + error)
},
},
{% comment %}
footerCallback: function (row, data, start, end, display) {
// THIS DOES NOT WORK because the ajax call is not done yet
// Leaving it here, because I'd like to find a fix
Expand Down Expand Up @@ -338,7 +337,17 @@
api.column(4).footer().innerHTML =
'$' + pageTotal + ' ( $' + total + ' total)';
}
} {% endcomment %}
}
})
billingRecordsTable.on('select', function (e, dt, type, indexes) {
$('#delete-selected').prop('disabled', false)
})
billingRecordsTable.on('deselect', function (e, dt, type, indexes) {
if (type === 'row' && billingRecordsTable.rows({selected: true}).count() > 0) {
$('#delete-selected').prop('disabled', false)
} else {
$('#delete-selected').prop('disabled', true)
}
})

})
Expand Down Expand Up @@ -382,7 +391,7 @@ <h2>Billing Records</h2>
<input id="start-notification" type="submit" value="Notify Lab Managers"></input>
</div>
<div class="righty">
<input id="delete-selected" type="submit" value="Delete Selected"></input>
<input id="delete-selected" type="submit" value="Delete Selected" disabled></input>
</div>
<div style="clear: both;"></div>
</div>
Expand Down

0 comments on commit 7d57697

Please sign in to comment.