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
},
Re: Hidden columns are exported anyway
Posted: Mon Sep 21, 2020 5:03 pm
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.
Re: Hidden columns are exported anyway
Posted: Mon Sep 21, 2020 5:06 pm
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!
Re: Hidden columns are exported anyway
Posted: Wed Jun 16, 2021 8:34 pm
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?
Re: Hidden columns are exported anyway
Posted: Wed Jun 16, 2021 8:55 pm
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.
How was this fixed? I still get the same behavior as in this thread's original post... :/
Re: Hidden columns are exported anyway
Posted: Wed Jun 23, 2021 10:08 pm
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.