Click on table rows to mark checkbox

This commit is contained in:
David Bomba 2019-08-28 15:19:36 +10:00
parent 1c31f6de0f
commit 17b2bc4e69
2 changed files with 24 additions and 10 deletions

View File

@ -60,8 +60,6 @@ class Number
*/
public static function formatMoney($value, $currency, $country, $settings)
{
Log::error('code = '.$settings->show_currency_code);
Log::error('symbol = '.$settings->show_currency_symbol);
$thousand = $currency->thousand_separator;
$decimal = $currency->decimal_separator;

View File

@ -136,14 +136,19 @@ $(document).ready(function() {
toggleButtonGroup();
$("#datatable").on('change', 'input[type=checkbox]', function() {
selected = [];
$.each($("input[name='hashed_ids[]']:checked"), function(){
selected.push($(this).val());
$('#datatable').on('click', '.odd, .even' ,function(e) {
if($(e.target).is(':checkbox')) return; //ignore when click on the checkbox
var $cb= $(this).find('input[type="checkbox"]');
$cb.prop('checked', !$cb.is(':checked'));
buildCheckboxArray();
});
toggleButtonGroup();
$("#datatable").on('change', 'input[type=checkbox]', function() {
buildCheckboxArray();
});
$('#table_filter').on('keyup', function(){
@ -179,6 +184,17 @@ $(document).ready(function() {
});
function buildCheckboxArray()
{
selected = [];
$.each($("input[name='hashed_ids[]']:checked"), function(){
selected.push($(this).val());
});
toggleButtonGroup();
}
function toggleButtonGroup()
{
if(selected.length == 0)