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)
},