Premium support for our pure JavaScript UI components


Post by clovisapp »

Hello Bryntum team,

I’m currently working on customizing the PDF export dialog in the Gantt component and have encountered a few issues and questions:

Locale keys not working for certain fields:
I’ve attempted to localize the dialog using LocaleHelper.publishLocale(). Most keys work fine, but I’m having trouble finding the correct keys for the rows and schedule range labels. Could you provide guidance or documentation on the exact locale key names for these two fields? Currently, the localization is not applied to them, and I’m unsure if I’m using the correct keys.

ExportDialog: {
      all: t("Gantt.exportGantt.allRows", "All Rows"),
      cancel: t("Gantt.exportDialog.cancelButton", "Cancel"),
      completeview: t("Gantt.exportDialog.completeView", "Complete Schedule"),
      currentview: t("Gantt.exportDialog.currentView", "Visible Schedule"),
      daterange: t("Gantt.exportDialog.dataRange", "Date Range"),
      export: t("Gantt.exportDialog.exportButton", "Export"),
      exporterType: t("Gantt.exportDialog.exporterTypeField", "Page Mode"),
      fileFormat: t("Gantt.exportDialog.fileFormat", "File Forma"),
      multipage: t("Gantt.exportDialog.multipage", "Multiple Pages"),
      multipagevertical: t(
        "Gantt.exportDialog.multipagevertical",
        "Multiple Page (vertical)"
      ),
      orientation: t("Gantt.exportDialog.orientationField", "Orientation"),
      paperFormat: t("Gantt.exportDialog.paperFormat", "Paper Format"),
      singlepage: t("Gantt.exportDialog.singlepage", "Single Page"),
      visible: t("Gantt.exportDialog.visible", "Visible Rows"),
    },

Hiding certain export dialog options:
I know I can hide entire fields by using hidden: true within the export dialog configuration, but I’m looking for a way to hide only some of the sub-options within a given field. For example, I only want to display two specific paper format options and hide the rest. Is there a recommended approach for selectively removing or hiding specific options rather than the entire field?

Adding custom paper format sizes:
Is it possible to add custom paper format sizes to the dialog, beyond the built-in formats provided by Bryntum? If so, how would I go about doing this?

Any guidance, documentation, or examples you can provide would be greatly appreciated.

Thanks in advance!

Image


Post by Animal »

What dialog are you seeing that is not localized that requires you to add some keys to a locale?

When I run the example it shows a set of fields all of which are localized:

Screenshot 2024-12-10 at 07.35.17.png
Screenshot 2024-12-10 at 07.35.17.png (128.68 KiB) Viewed 579 times

Post by Animal »

You can reconfigure any of the fields there by accessing their documented refs and just specifying configuration objects:

Screenshot 2024-12-10 at 07.50.52.png
Screenshot 2024-12-10 at 07.50.52.png (388.15 KiB) Viewed 579 times

The item refs are listed here: https://bryntum.com/products/gantt/docs/api/Grid/view/export/ExportDialog

So you see fileFormatField there, so specify it in the items and you can configure the field.


Post by clovisapp »

Hello,

Thank you for your earlier response. I followed your example and added the following configuration to the pdfExport feature:

paperFormatField: {
  store: {
    filters: [
      {
        operator: "isIncludedIn",
        property: "id",
        value: ["A3", "A4", "A5", "A6"],
      },
    ],
  },
},

While this successfully filters the available options, it is causing an "Export failed" error when I attempt to export. Could you please help me understand why this might be happening and how to resolve the issue?

Image


Post by Animal »

How is simple reducing the number of options available in a combo which chooses paper size causing an export failed error?

Take thet field override out.

Also, what is the error? Where is it? What's the stack trace etc etc


Post by clovisapp »

Hi, I share with you the video of the error.
Basically when I try to hide a couple of options, the download toast says ‘Export filed’.
This does not generate console errors or requests to the export backend.

e59d26a33d6943d3b1e8b5e0292f0c08.mp4
(4.11 MiB) Downloaded 27 times

Image


Post by alex.l »

Thanks for video! I was able to reproduce this. Ticket https://github.com/bryntum/support/issues/10509
You can subscribe on ticket updates to be notified when it's done.

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy

We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services


Post by Animal »

This is a bug: https://github.com/bryntum/support/issues/10510

It should work if you access the field dynamically and add the filter to its store after it's created.


Post Reply