chg: [genericElement:index_table] Generic support of bulk operations
parent
7ec0dabd0b
commit
bb6489778f
|
@ -13,7 +13,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo sprintf(
|
echo sprintf(
|
||||||
'<input class="select_attribute select" type="checkbox" data-rowid="%s" %s>',
|
'<input class="selectable_row select" type="checkbox" data-rowid="%s" %s>',
|
||||||
h($k),
|
h($k),
|
||||||
empty($data) ? '' : implode(' ', $data)
|
empty($data) ? '' : implode(' ', $data)
|
||||||
);
|
);
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
$header_data = sprintf(
|
$header_data = sprintf(
|
||||||
'<input id="select_all" class="%s" type="checkbox" %s>',
|
'<input id="select_all" class="%s" type="checkbox" %s>',
|
||||||
empty($header['select_all_class']) ? 'select_all' : $header['select_all_class'],
|
empty($header['select_all_class']) ? 'select_all' : $header['select_all_class'],
|
||||||
empty($header['select_all_function']) ? 'onclick="toggleAllAttributeCheckboxes();"' : 'onclick="' . $header['select_all_function'] . '"'
|
empty($header['select_all_function']) ? 'onclick="toggleAllAttributeCheckboxes(this);"' : 'onclick="' . $header['select_all_function'] . '"'
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$header_data = h($header['name']);
|
$header_data = h($header['name']);
|
||||||
|
@ -38,14 +38,3 @@
|
||||||
$thead .= '</thead>';
|
$thead .= '</thead>';
|
||||||
echo $thead;
|
echo $thead;
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function() {
|
|
||||||
$('.select_attribute').add('#select_all').on('change', function() {
|
|
||||||
if ($('.select_attribute:checked').length > 0) {
|
|
||||||
$('.mass-select').show();
|
|
||||||
} else {
|
|
||||||
$('.mass-select').hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
|
@ -93,7 +93,8 @@
|
||||||
}
|
}
|
||||||
$tbody = '<tbody>' . $rows . '</tbody>';
|
$tbody = '<tbody>' . $rows . '</tbody>';
|
||||||
echo sprintf(
|
echo sprintf(
|
||||||
'<table class="table table-hover" id="index-table-%s">%s%s</table>',
|
'<table class="table table-hover" id="index-table-%s" data-table-random-value="%s">%s%s</table>',
|
||||||
|
$tableRandomValue,
|
||||||
$tableRandomValue,
|
$tableRandomValue,
|
||||||
$this->element(
|
$this->element(
|
||||||
'/genericElements/IndexTable/headers',
|
'/genericElements/IndexTable/headers',
|
||||||
|
@ -114,6 +115,7 @@
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$('#index-table-<?= $tableRandomValue ?>').data('data', <?= json_encode($data['data']) ?>);
|
||||||
$('.privacy-toggle').on('click', function() {
|
$('.privacy-toggle').on('click', function() {
|
||||||
var $privacy_target = $(this).parent().find('.privacy-value');
|
var $privacy_target = $(this).parent().find('.privacy-value');
|
||||||
if ($(this).hasClass('fa-eye')) {
|
if ($(this).hasClass('fa-eye')) {
|
||||||
|
|
|
@ -18,6 +18,13 @@ function executeStateDependencyChecks(dependenceSourceSelector) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleAllAttributeCheckboxes(clicked) {
|
||||||
|
let $clicked = $(clicked)
|
||||||
|
let $table = $clicked.closest('table')
|
||||||
|
let $inputs = $table.find('input.selectable_row')
|
||||||
|
$inputs.prop('checked', $clicked.prop('checked'))
|
||||||
|
}
|
||||||
|
|
||||||
function testConnection(id) {
|
function testConnection(id) {
|
||||||
$container = $(`#connection_test_${id}`)
|
$container = $(`#connection_test_${id}`)
|
||||||
UI.overlayUntilResolve(
|
UI.overlayUntilResolve(
|
||||||
|
|
Loading…
Reference in New Issue