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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Scheduler: ScrollTo on created with resources

Thread ID:

Created:

Updated:

Platform:

Replies:

142767 Feb 18,2019 04:47 PM UTC Feb 20,2019 03:53 AM UTC JavaScript - EJ 2 3
loading
Tags: Schedule
Arwin
Asked On February 19, 2019 09:07 AM UTC

Hi,

I'm trying to set the scrollTo time on creation of the schedule object so I have this:

ejs-schedule id="Schedule" ref="scheduleObj" width='100%' height='550px' :created="onCreated" :selectedDate="selectedDate"
                      :eventSettings='eventSettings' :group='group'>
            e-views>
               e-view option="Week"> /e-view>
            /e-views>
            e-resources>
                e-resource field='ConferenceId' title='Attendees' name='Conferences' :allowMultiple='allowMultiple' :dataSource='resourceDataSource'
                            textField='Text' idField='Id' colorField='Color'>
                /e-resource>
            /e-resources>
        /ejs-schedule>
(< symbols removed)

The onCreated method
onCreated: function(args) {
            this.$refs.scheduleObj.scrollTo('18:00')
        },

And the error I get: 
TypeError: Cannot read property 'scrollToHour' of undefined
    at Schedule.scrollTo (schedule.js?67fb:1100)
    at VueComponent.ScheduleComponent.scrollTo (schedule.component.js?7a88:245)
    at VueComponent.onCreated (Calendar2.vue?5052:577)
    at Observer.notify (observer.js?6607:89)
    at Schedule.Base.trigger (base.js?54ff:149)
    at VueComponent.ScheduleComponent.trigger (schedule.component.js?7a88:61)
    at Schedule.Component.appendTo (component.js?02b4:131)
    at VueComponent.ComponentBase.mounted (component-base.js?3cd2:42)
    at callHook (vue.common.js?2371:2923)
    at Object.insert (vue.common.js?2371:4160) 

When I remove the Resources tag the scrolling is working fine. Anyone an idea?

Edit: when I set a Timeout it works:
 onCreated: function(args) {
            const self = this
            setTimeout(function() {
                // In timeout otherwise with resource view it wont work
                self.$refs.scheduleObj.scrollTo('18:00')
            }, 500)
        },



Karthigeyan Krishnamurthi [Syncfusion]
Replied On February 19, 2019 10:08 AM UTC

 
Thank you for contacting Syncfusion support. 
 
In resource sample, promise will be resolved slower compared to default sample. Therefore, only unable to get the Schedule instance in created event which is the cause for the issue. Kindly use dataBound event as below. 
 
:dataBound="onDataBound" 
 
flag: true, 
 
onDataBound: function(args) { 
      if (this.flag) { 
        this.$refs.scheduleObj.scrollTo("18:00"); 
        this.flag = false; 
      } 
    } 
 
 
Regards, 
Karthigeyan 
 


Arwin
Replied On February 19, 2019 01:45 PM UTC

Thank you Karthigeyan, this is working!

Karthigeyan Krishnamurthi [Syncfusion]
Replied On February 20, 2019 03:53 AM UTC

 
We are happy that our solution fulfilled your requirement. 
 
Regards, 
Karthigeyan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon