mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 08:21:37 +08:00
Fixed samples table all rows un/checking. [SCI-845]
This commit is contained in:
parent
09ef3b3ad5
commit
72df48500d
1 changed files with 6 additions and 5 deletions
|
|
@ -201,7 +201,7 @@ function dataTableInit() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle click on "Select all" control
|
// Handle click on "Select all" control
|
||||||
$('#samples thead input[name="select_all"]').on('click', function(e) {
|
$('.dataTables_scrollHead input[name="select_all"]').on('click', function(e) {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
$('#samples tbody input[type="checkbox"]:not(:checked)').trigger('click');
|
$('#samples tbody input[type="checkbox"]:not(:checked)').trigger('click');
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -233,10 +233,11 @@ $.fn.dataTable.defaults.noSearchHidden = true;
|
||||||
|
|
||||||
// Updates "Select all" control in a data table
|
// Updates "Select all" control in a data table
|
||||||
function updateDataTableSelectAllCtrl(table) {
|
function updateDataTableSelectAllCtrl(table) {
|
||||||
var $table = table.table().node();
|
var $table = table.table().node();
|
||||||
var $chkbox_all = $('tbody input[type="checkbox"]', $table);
|
var $header = table.table().header();
|
||||||
var $chkbox_checked = $('tbody input[type="checkbox"]:checked', $table);
|
var $chkbox_all = $('tbody input[type="checkbox"]', $table);
|
||||||
var chkbox_select_all = $('thead input[name="select_all"]', $table).get(0);
|
var $chkbox_checked = $('tbody input[type="checkbox"]:checked', $table);
|
||||||
|
var chkbox_select_all = $('input[name="select_all"]', $header).get(0);
|
||||||
|
|
||||||
// If none of the checkboxes are checked
|
// If none of the checkboxes are checked
|
||||||
if($chkbox_checked.length === 0){
|
if($chkbox_checked.length === 0){
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue