Our powerful JS Calendar component


Post by tokytok »

Hi,
I'm using the loadOnDemand Feature :
https://www.bryntum.com/docs/calendar/#Calendar/feature/LoadOnDemand

I'm trying to disable the feature when user switch to other than DayView :

features : {
    loadOnDemand : true
}
listeners: {
    activeItemChange: ({activeItem}) => {
        calendar.features.loadOnDemand.disabled = !activeItem instanceof bryntum.calendar.DayView;
    }
}

The disabled boolean switch to "true" but loadOnDemand stay enabled.
Is it a bug ? If not, how disable the feature ?

Thanks.


Post by Maxim Gorkovsky »

Hello.
This feature cannot be disabled in runtime which looks like a bug to me. I opened a ticket here: https://github.com/bryntum/support/issues/3162 Thank you for report!

As a temporary workaround you can try this:

Override.apply(class {
  static get target() {
    return { class : LoadOnDemand };
  }
  
  loadDateRange() {
    if (this.disabled) { return; }
    return this._overridden.loadDateRange.apply(this, arguments)
  }
})

Post Reply