Added "select all" control

Fixed #8812
This commit is contained in:
Steve Beaver 2018-08-20 08:00:29 -04:00
parent e2328f897c
commit e969408dc1
2 changed files with 16 additions and 2 deletions

View File

@ -226,7 +226,7 @@ $columns_in_table = 13;
<table id="ruletable" class="table table-striped table-hover table-condensed">
<thead>
<tr>
<th><!-- Checkbox --></th>
<th style="padding-left:10px;"> <input type="checkbox" id="selectAll" name="selectAll" /></th>
<th><!-- Icon --></th>
<th><!-- Rule type --></th>
<th><?=gettext("Interface")?></th>
@ -541,6 +541,13 @@ events.push(function() {
return undefined;
}
});
$('#selectAll').click(function() {
var checkedStatus = this.checked;
$('#ruletable tbody tr').find('td:first :checkbox').each(function() {
$(this).prop('checked', checkedStatus);
});
});
});
//]]>
</script>

View File

@ -352,7 +352,7 @@ $columns_in_table = 13;
<table id="ruletable" class="table table-hover table-striped table-condensed" style="overflow-x: 'visible'">
<thead>
<tr>
<th><!-- checkbox --></th>
<th style="padding-left:10px;"> <input type="checkbox" id="selectAll" name="selectAll" /></th>
<th><!-- status icons --></th>
<th><?=gettext("States")?></th>
<th><?=gettext("Protocol")?></th>
@ -984,6 +984,13 @@ events.push(function() {
$('[id^=Xmove_]').attr("title", "<?=$XmoveTitle?>");
}
});
$('#selectAll').click(function() {
var checkedStatus = this.checked;
$('#ruletable tbody tr').find('td:first :checkbox').each(function() {
$(this).prop('checked', checkedStatus);
});
});
});
//]]>
</script>