Fix #18867: Check-all checkbox should be unchecked on page load when GridView have no rows (#19764)

This commit is contained in:
PowerGamer1
2023-02-20 17:21:00 +02:00
committed by GitHub
parent e8bf240c80
commit f388ca71b0

View File

@ -198,7 +198,9 @@
$grid.find(checkAllInput + (all ? ":not(:checked)" : ":checked")).prop('checked', all).change();
};
initEventHandler($grid, 'checkRow', 'click.yiiGridView', "#" + id + " " + inputs, handler);
handler(); // Ensure "check all" checkbox is checked on page load if all data row checkboxes are initially checked.
if($grid.find(inputs).length) {
handler(); // Ensure "check all" checkbox is checked on page load if all data row checkboxes are initially checked.
}
},
getSelectedRows: function () {