Our state of the art Gantt chart


Post by Jerther »

Hello!!

Here are the steps to replicate:

  • Open the export demo
  • Right click on the left grid header, Columns, and uncheck "Start Date"
  • Hit the export button and accept the default settings
  • Download the pdf file and open it

Result:

  • The "Start Date" column is visible

Expected:

  • The "Start Date" column is not visible

Additional details:

  • This also occurs with this setting enabled:
    keepRegionSizes : {
        locked : true
    },

Post by fabio.mazza »

Hi Jerther,

If you want to remove "Start Date" from PDF on export, you have to remove it from field "Columns" on "Export Settings" window after you click on export.

If you have any question, please let us know.

Best regards,
Fabio


Post by Jerther »

Oh, I see. I have to present the user with the currently displayed columns as the default export setting.

I'll do that thanks!


Post by Jerther »

Hi Fabio,

It's been a while and I just got to do this point. So I looked how I could do this programmatically, but I can't find anything in the documentation. I understand I have to manually remove the unwanted columns in the dialog, but how can I do this with code?

From what I gather, the columns field in the export dialog is populated directly from the Gantt instance's columns property, and they are filtered only by their isLeaf and exportable properties. Now I could set the invisible columns as not exportable, but then I would have the opposite problem: they wouldn't be selectable to be added.

Now I guess the only options are to listen for an event on the export dialog and remove the hidden columns from the columns field values but there is nothing in https://www.bryntum.com/docs/gantt/#Gantt/feature/export/PdfExport#events that seems relevant, or extend my own export dialog class but how do I set it to replace the original?

Any suggestion?


Post by Jerther »

I've come up with this solution which works very well now, but it relies on private stuff so I'd rather hear from you instead.

gantt.features.pdfExport.showExportDialog();
const columns = gantt.features.pdfExport.exportDialog.columnsStore.allRecords;
const columnsField = gantt.features.pdfExport.exportDialog.widgetMap.columnsField;
columnsField.value = columns.filter(c => !c.hidden);

Post by mats »

This is a bug yes, should've been opened right after your first post. Sorry about that, ticket opened here and we'll get it fixed! https://github.com/bryntum/support/issues/3036


Post by Jerther »

Thanks mats, no problem :)


Post by Jerther »

Hi Mats,

How was this fixed? I still get the same behavior as in this thread's original post... :/


Post by Maxim Gorkovsky »

Hello.
You're right, I can still reproduce the problem on gantt and scheduler online demos. And also on grid in some cases. I've reopened the ticket. Thank you for the update and my apologies for this confusion.


Post Reply