Our powerful JS Calendar component
Hi,
I've recently started using the calendar and was hardwiring data in a query. We now need to move this out and have it load data on demand in response to user's date selection.
I assume Bryntum calendar manages all this but I'm struggling with it. Can you take a look at the code below and let me know what's missing. Can't find any docs on what is a basic use case. There's no parameters being passed to the server for the startdate & enddate
Thanks in advance
-
Attachments
-
- Capture.JPG (159.64 KiB) Viewed 600 times
-
- Capture.JPG (48.42 KiB) Viewed 603 times
I don't think the CrudManager should be autoLoad : true
. That will do a full load with no start/end params (Which I assume your server honours with every event in existence)
When LoadOnDemand is used, the CrudManager gets kicked into life only when a view requests a certain date range from a store which is not loaded into the store.
Oh, i see your server returns a 500 error if there are no start/end parameters. Not sure it should do that.
Thanks Animal,
Nothing is being sent to the server now - is there another _init() call we need to make to get the call sent ?
(the 500 is easily fixed - it's in debug mode while I figure this out).
What's that request to /resource_events
? That's the CrudManager trying to load itself isn't it?
That's the backend URL - it's no longer being called since autoLoad: true was removed. So we've got no data
So without autoLoad: true on the CrudManager, the first view which requests data from the event store should cause the Calendar to fire its dateRangeChange
event which the LoadOnDemand feature listens for to load the CrudManager.
Set a breakpoint in LoadOnDemand.loadDateRange
It's not firing - nothing in the breakpoints. It's configured as it should be.
The query is now defaulted when no params to return data from now() - now() + 1 month.
No date ranges evident anywhere in the URL. Is there a way of being notified when it's needed and dooing the requisite call manually ?
It's crazy - this must be the simplest use case involving dynamic data.
Can you point us at an example where it works properly ?
thanks again.
-
Attachments
-
- Capture.JPG (31.23 KiB) Viewed 577 times
-
- Capture.JPG (48.9 KiB) Viewed 577 times
-
- Capture.JPG (103.07 KiB) Viewed 577 times
So the Calendar never asks for any events. If the app throws an error, that is expected.