Our powerful JS Calendar component


Post by farrukhwaseem »

On 5.1.3 version of Calendar, when we open it throws 2 js errors in Chrome console. Please suggest.

CalendarLoadJSError.gif
CalendarLoadJSError.gif (592.09 KiB) Viewed 515 times

Post by mats »

Any way we can reproduce this? Can you upload a small test case so we can debug it?


Post by Animal »

Or set a debug breakpoint in one of those methods you see in the stack trace.

Screenshot 2022-09-22 at 11.18.53.png
Screenshot 2022-09-22 at 11.18.53.png (264.73 KiB) Viewed 512 times

I suggest in your reloadCalendar method, and step it and see why it's calling Printer methods from the load.


Post by farrukhwaseem »

Thanks for the quick response Animal. I debugged and tried to show the code execution steps. Please have a look.

CalendarLoadJSErrorDebug.gif
CalendarLoadJSErrorDebug.gif (1 MiB) Viewed 510 times

Post by Animal »

Well, I can't pause gifs so it just disappears. It looks like you're in a loop


Post by Animal »

Why would it keep firing dateRangeChange if the load sucessfully provided the range the view is looking for?

What are the parameters being sent calendarStart, calendarEnd? Where do they come from? What are they when you step the code?.

The dates needed are provided in the dateRangeChange event. Use those.


Post by farrukhwaseem »

calendaStart/End are just variables, I initialize these variables inside the dateRangeChange event already. And then being passed to reloadCalendar function. When crudManager.load gets called inside reloadCalendar, it triggers dateRangeChange event again. Which is looping itself I think is the issue here. After 3rd call it stops after logging the JS error in browser console.

You can have a look at below screen shot.

dateRangeChange.png
dateRangeChange.png (39.18 KiB) Viewed 500 times

Post by Animal »

Just a thought. You haven't configured your CrudManager autoLoad : true have you?


Post by farrukhwaseem »

We set this to false in our config. Because we want to call it ourself after we initialize the start / end dates. Btw I tried after set it to true. Looks it still gives same error.

CalendarCrudManagerConfig.png
CalendarCrudManagerConfig.png (66.39 KiB) Viewed 480 times

Post by Animal »

You explicitly call CrudManager load?


Post Reply