Page 2 of 2

Re: JS error on calendar load

Posted: Fri Sep 23, 2022 9:05 am
by Animal

Really, the loadOnDemand feature should handle this for you.

But I see that you are sending some extra parameters though.

Right now, you would need to add some listener deep down to CrudManager to intercept and add those params. I will make it easier for you to change the parameter set that loadOnDemand creates.

https://github.com/bryntum/support/issues/5311


Re: JS error on calendar load

Posted: Sat Sep 24, 2022 4:17 pm
by Animal

So, I have added the following configuration to the loadOnDemand feature to make it very easy to add extra parameters to the load request. I'm hoping to get it into the next release:

Screenshot 2022-09-24 at 16.12.41.png
Screenshot 2022-09-24 at 16.12.41.png (58.31 KiB) Viewed 292 times

So you might do something like:

        calendar = new Calendar({
            date     : new Date(2019, 9, 14),
            sidebar  : false,
            mode     : 'week',
            features : {
                loadOnDemand : {
                    // up. means it looks on the ownership hierarchy
                    // We have injected it into the Calendar as a config
                    beforeRequest : 'up.onBeforeRequest'
                }
            },
            crudManager : {
                transport : {
                    load : {
                        url    : 'blah...',
                    }
                }
            },
            onBeforeRequest(options) {
                // Add an extra parameter to the request
                options.request.params.dynamicallyAddedExtraParam = 'extraParamValue';
            }
        });