diff --git a/frappe/printing/page/print_format_builder/print_format_builder.js b/frappe/printing/page/print_format_builder/print_format_builder.js index eb91f44141..bae82ba040 100644 --- a/frappe/printing/page/print_format_builder/print_format_builder.js +++ b/frappe/printing/page/print_format_builder/print_format_builder.js @@ -707,22 +707,24 @@ frappe.PrintFormatBuilder = class PrintFormatBuilder { // Toggle all checkboxes in column selector const toggle_all_checkboxes = function (should_check, should_clear_value) { // Scope to column selector list checkboxes only - $body.find(".column-selector-list input[type='checkbox'][data-fieldname]").each(function () { - const $checkbox = $(this); - const is_checked = $checkbox.prop("checked"); - - // Only process checkboxes that need to be changed - if ((should_check && !is_checked) || (!should_check && is_checked)) { - $checkbox.prop("checked", should_check); - const fieldname = $checkbox.attr("data-fieldname"); - const input = get_width_input(fieldname); - input.prop("disabled", !should_check); - - if (should_clear_value) { - input.val(""); + $body + .find(".column-selector-list input[type='checkbox'][data-fieldname]") + .each(function () { + const $checkbox = $(this); + const is_checked = $checkbox.prop("checked"); + + // Only process checkboxes that need to be changed + if ((should_check && !is_checked) || (!should_check && is_checked)) { + $checkbox.prop("checked", should_check); + const fieldname = $checkbox.attr("data-fieldname"); + const input = get_width_input(fieldname); + input.prop("disabled", !should_check); + + if (should_clear_value) { + input.val(""); + } } - } - }); + }); update_column_count_message(); };