Premium support for our pure JavaScript UI components


Post by pzs »

Hi,

using SchedulerPro 5.1.1 with eventLayout+layoutFn, PDF export throws an Error and the view messed up (no event is visible anymore).
See the exception attached.

How to reproduce:

  • Get the examples-scheduler/export/ example
  • replace the Scheduler to SchedulerPro:
    import Scheduler from '../../lib/SchedulerPro/view/SchedulerPro.js';
  • add the eventLayout config (this config copied from the docs: https://www.bryntum.com/docs/scheduler-pro/api/SchedulerPro/view/SchedulerPro#config-eventLayout )
        eventLayout : {
            layoutFn : items => {
                items.forEach(item => {
                    item.top = 100 * Math.random();
                    item.height = 100 * Math.random();
                });
    
        return 100;
    }
        },
    
    • open the application and do a PDF export

    Actual: PDF export succeed, although it throw an error and the view is not restored, events are messed up
    Excepted: After successful PDF export scheduler view is restored/usable, no javascript error.

    We currently do not have any workaround, so we are waiting for the fix or for a workaround asap.

    Thanks.
Attachments
err.png
err.png (17.91 KiB) Viewed 339 times

Post by marcio »

Hi pzs,

Thanks for the detailed report. I was able to reproduce it and it's indeed a bug. I created a ticket to fix it https://github.com/bryntum/support/issues/5050

Best regards,
Márcio


Post by pzs »

Hi,
Is there any update about this ticket? Do you have any workaround what we can use?


Post by Maxim Gorkovsky »

Hello.
Workaround would be to skip restoring eventLayout:

Override.apply(class {
  static target = { class : SchedulerPro }

  applyState(state) {
    delete state.eventLayout;
    return this._overridden.applyState.call(this, state);
  }
});

Post Reply