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 51f33c0706..ff1c2c8c88 100644 --- a/frappe/printing/page/print_format_builder/print_format_builder.js +++ b/frappe/printing/page/print_format_builder/print_format_builder.js @@ -704,6 +704,33 @@ frappe.PrintFormatBuilder = class PrintFormatBuilder { update_column_count_message(); }); + // Select All functionality + $body.on("click", ".select-all-btn", function () { + $body.find("input[type='checkbox']").each(function () { + if (!$(this).prop("checked")) { + $(this).prop("checked", true); + var fieldname = $(this).attr("data-fieldname"); + var input = get_width_input(fieldname); + input.prop("disabled", false); + } + }); + update_column_count_message(); + }); + + // Unselect All functionality + $body.on("click", ".unselect-all-btn", function () { + $body.find("input[type='checkbox']").each(function () { + if ($(this).prop("checked")) { + $(this).prop("checked", false); + var fieldname = $(this).attr("data-fieldname"); + var input = get_width_input(fieldname); + input.prop("disabled", true); + input.val(""); + } + }); + update_column_count_message(); + }); + d.show(); return false; diff --git a/frappe/printing/page/print_format_builder/print_format_builder_column_selector.html b/frappe/printing/page/print_format_builder/print_format_builder_column_selector.html index adc87fff22..5bf8764c26 100644 --- a/frappe/printing/page/print_format_builder/print_format_builder_column_selector.html +++ b/frappe/printing/page/print_format_builder/print_format_builder_column_selector.html @@ -3,6 +3,12 @@

{{ __("Some columns might get cut off when printing to PDF. Try to keep number of columns under 10.") }}

+
+
+ + +
+

{{ __("Column") }}

{{ __("Width") }}