Merge pull request #28690 from iamejaaz/select-all-column-child-table

feat: add select all button to select all column in child table
This commit is contained in:
Sumit Bhanushali 2024-12-08 10:14:11 +05:30 committed by GitHub
commit 4bb972e0b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -464,6 +464,8 @@ export default class GridRow {
sort_options: false,
},
],
secondary_action_label: __("Select All"),
secondary_action: () => this.select_all_columns(docfields),
});
d.set_primary_action(__("Add"), () => {
@ -488,6 +490,17 @@ export default class GridRow {
d.show();
}
select_all_columns(docfields) {
docfields.forEach((docfield) => {
if (docfield.checked) {
return;
}
$(`.checkbox.unit-checkbox input[type="checkbox"][data-unit="${docfield.value}"]`)
.prop("checked", true)
.trigger("change");
});
}
prepare_columns_for_dialog(selected_fields) {
let fields = [];