- Home
- Forum
- JavaScript - EJ 2
- Scheduler: ScrollTo on created with resources
Scheduler: ScrollTo on created with resources
Hi,
e-view option="Week"> /e-view>
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-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)
},
SIGN IN To post a reply.
3 Replies
KK
Karthigeyan Krishnamurthi
Syncfusion Team
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
AR
Arwin
February 19, 2019 01:45 PM UTC
Thank you Karthigeyan, this is working!
KK
Karthigeyan Krishnamurthi
Syncfusion Team
February 20, 2019 03:53 AM UTC
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
AR Arwin
- Feb 18, 2019 04:47 PM UTC
- Feb 20, 2019 03:53 AM UTC