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:
commit
4bb972e0b9
1 changed files with 13 additions and 0 deletions
|
|
@ -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 = [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue