Our pure JavaScript Scheduler component


Post by kevinvdheuvel »

We can't use AjaxStore because it is not configurable (as far as I know) what the HTTP method of the 'read' request is. This seems to always do GET. Our web services are all called via POST with arguments.

So I was trying to implement a custom Store, but it seems like the Scheduler wants an instance of type ResourceStore for the 'resourceStore' and EventStore for the 'eventStore' according to the typescript definition and documentation. These both extend of AjaxStore.

I tried using a custom implementation of Store, but it seems like the 'eventStore' is then converted to a EventStore/AjaxStore anyway?
When I log the eventStore to the console after the scheduler is initialized, it has the 'autoLoad' property (which is part of AjaxStore)

Below the code I'm roughly using.
class MyStore extends Store {
    ...
}
interface MyCustomConfig {
    ...
    resourceStore: MyStore;
    eventStore: MyStore;
}
class MyScheduler extends Scheduler {
    construct(customConfig: MyCustomConfig) {
        super.construct({
            ...
            resourceStore: customConfig.resourceStore,
            eventStore: customConfig.eventStore
        })
    }
}
And in the browser I initialize it like this:
var resourceStore = new MyStore({...});
var eventStore = new MyStore({...});
var scheduler = new MyScheduler({
    ...
    resourceStore: resourceStore,
    eventStore: eventStore
});

Post by mats »

As of the next release v2.0.1, AjaxStore is configurable and you can control all aspects of the Fetch request. Should be in the nightly builds shortly.

Post by kevinvdheuvel »

mats wrote: Wed Apr 17, 2019 12:01 pm As of the next release v2.0.1, AjaxStore is configurable and you can control all aspects of the Fetch request. Should be in the nightly builds shortly.
Also for trial users?

Just to confirm, the Scheduler doesn't support custom Store's then? It has to be a ResourceStore or EventStore?

Post by pmiklashevich »

When 2.0.1 is out you can download a new trial. Users who have license also have an access to our customer zone where they can download nightly builds. Nightly builds have the latest changes.

Yes, Scheduler requires Event store and Resource store to be specified. You can extend store classes to modify them or just override existing classes. Please see the docs here: https://www.bryntum.com/docs/scheduler/ ... n/Override

Pavlo Miklashevych
Sr. Frontend Developer


Post by kevinvdheuvel »

Any idea when 2.0.1 is expected to be released?
Could a get a trial version of the latest nightly build perhaps?

Post by mats »

If you have a license - you can download nightly builds from our customer zone. https://customerzone.bryntum.com

Post by kevinvdheuvel »

mats wrote: Wed Apr 17, 2019 12:01 pm As of the next release v2.0.1, AjaxStore is configurable and you can control all aspects of the Fetch request. Should be in the nightly builds shortly.
With 2.0.2 and fetchOptions configuration of a Resource or EventStore I still can't configure the HTTP method that is used for a create, read, update or delete call. Why can we not control this?

Post by mats »

Works fine for me, can you please show how you try to do it?
 store : {
        fetchOptions : {
            method: 'PUT'
        },
Provides:
Request URL: https://lh/grid/examples/treeloadondemand/php/read.php
Request Method: PUT
Status Code: 200 OK
Remote Address: 127.0.0.1:80
Referrer Policy: no-referrer-when-downgrade

Post by kevinvdheuvel »

mats wrote: Tue May 14, 2019 4:10 pm Works fine for me, can you please show how you try to do it?
 store : {
        fetchOptions : {
            method: 'PUT'
        },
Provides:
Request URL: https://lh/grid/examples/treeloadondemand/php/read.php
Request Method: PUT
Status Code: 200 OK
Remote Address: 127.0.0.1:80
Referrer Policy: no-referrer-when-downgrade
Thank you, I figured out why it was doing a GET request.
I was adding parameters to the request in the 'beforeLoad' event of the store. It seems to add those parameters as query parameters and then does a GET request.

How can I add parameters to a POST request, so the parameters are supplied as request body?

Post by mats »


Post Reply