We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

error on resizing

This is a two part issue. 

I am trying to get the schedule to adjust appointments with the resizing of the browser window. I have tried two different methods.

1. Let schedule try to adjust self and with my current setup the appointments lose position in resource area (see images in zip)

2. using an event listener to refresh the calendar generates an error

code for refresh:
        window.addEventListener('resize', function(e){
if($(window).width() < 1200){var cellWd = '240px';}
            else{var cellWd = false;}
var calOpen = $("#calendar-area").data('ejSchedule');
$("#calendar-area").ejSchedule({cellWidth: cellWd});

generates this error when refresh is called

Uncaught TypeError: this._appointmentSettings.resourceFields.split(...)[h].trim is not a function(…)
_addAppData @ ej.web52.all.min.js:10
_multipleDayApp @ ej.web52.all.min.js:10
_appointmentProcessing @ ej.web52.all.min.js:10
_dataProcessing @ ej.web52.all.min.js:10
_bindAppointmentsData @ ej.web52.all.min.js:10
_init @ ej.web52.all.min.js:10refresh @ ej.web52.all.min.js:10
(anonymous function) @ portal.core.js:652

line 652 is the  calOpen.refresh(); in above code.

let me know if you need more information that I can provide to try and fix this issue. 


Attachment: resize1_b240cc46.zip

5 Replies

DB David Barrett December 5, 2016 04:07 PM UTC

I also noticed the error does not happen when you go from full screen to whatever non-full screen size your browser last remembers. But happens once you hand resize the window.


KK Karthigeyan Krishnamurthi Syncfusion Team December 6, 2016 12:38 PM UTC

Hi David,   
Thank you for contacting Syncfusion support.   
We were unable to reproduce the reported issue “Script error occurs while using event listener” at our end and for the same we have prepared the below sample with the provided code example.   
Kindly try the above sample and if the issue persists, try to reproduce the error in a sample and revert. Or else you can also share your runnable sample (if possible) to proceed further.


DB David Barrett December 6, 2016 03:39 PM UTC

I made some adjustments and can get some of the issue 

http://jsplayground.syncfusion.com/xwtlh1mw (I also attached a zip with html download if the playground doesnt work) 

Load this and move the center bar around in the middle. Sometimes the bottom resource covers more than one day and other events seem to move around occasionally seeming to move days. Refreshing brings back to normal again. 

If that doesn't work then I will have to work up how to show you mine since I don't do the loading of events,blocks, and resources like you at start since I am using php and loading the calendar and then loading the events after the calender is loaded

Attachment: ScheduleJSHorizontalMulitpleResource_e9ab218b.zip

DB David Barrett December 6, 2016 03:41 PM UTC

heres an image of what it does on the playground 

Attachment: playground_6e5d4f0c.zip

KK Karthigeyan Krishnamurthi Syncfusion Team December 8, 2016 12:56 PM UTC

Hi David,    
Thanks for your update. 
Every time when the Scheduler is refreshed using refresh function time zone is added, which in turn increase an appointment duration. It is the cause for the issue and to overcome the issue kindly follow any one of the following ways. 
1.     applyTimeOffset 
Kindly visit the below link to know more about this property and for the same we have prepared the below sample for your reference. 

2.     start/endTimeZone 
We request you to use same values for timeZone, StartTimeZone and EndTimeZone fields to render the appointment as same as the time given in data base. Please read here to know briefly about those 2 properties  http://help.syncfusion.com/js/schedule/globalization-and-localization#time-zone and find the example code to use it on the sample from here http://help.syncfusion.com/js/api/ejschedule#members:appointmentsettings-starttimezone 

Live Chat Icon For mobile
Up arrow icon