From 7539c76471a73296d8d068809bc6b800d2b20d58 Mon Sep 17 00:00:00 2001 From: circlecrystalin Date: Tue, 20 Jan 2026 12:17:44 +0100 Subject: [PATCH] feat: Add Select All/Unselect All option in Select Table Columns dialog --- .../print_format_builder.js | 27 +++++++++++++++++++ .../print_format_builder_column_selector.html | 6 +++++ 2 files changed, 33 insertions(+) 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") }}