This is a migrated thread and some comments may be shown as answers.

calling dataSource.read() while dragging an event causes crashes in kendo

3 Answers 79 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 19 Sep 2014, 01:42 PM
I'm refreshing my dataSource by calling dataSource.read(). But  I'm getting strange crashes inside kendo internals if this happens when the user is dragging an event.

"Cannot read property 'update' of undefined"
"TypeError: Cannot read property 'update' of undefined
    at Widget.extend._updateEvent.updateEvent (http://localhost:64767/Scripts/kendo/kendo.all.js:75279:26)
    at Widget.extend._updateEvent (http://localhost:64767/Scripts/kendo/kendo.all.js:75347:17)
    at null.<anonymous> (http://localhost:64767/Scripts/kendo/kendo.all.js:75093:34)
    at Class.extend.trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:179:33)
    at Widget.extend._trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:14791:25)
    at Widget.extend._end (http://localhost:64767/Scripts/kendo/kendo.all.js:14769:18)
    at jQuery.extend.proxy.proxy (http://localhost:64767/Scripts/jquery-1.10.2.js:841:14)
    at Class.extend.trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:179:33)
    at Observable.extend.notify (http://localhost:64767/Scripts/kendo/kendo.all.js:13816:25)
    at Class.extend._trigger (http://localhost:64767/Scripts/kendo/kendo.all.js:13662:32)"
Is there anything I do to detect when the user is performing a drag?

Cheers, Paul.

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 23 Sep 2014, 10:29 AM
Hello Paul,

I would recommend using the Scheduler's moveStart and moveEnd event handlers to raise and lower a flag that should be checked before calling the DataSource's read method.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Paul
Top achievements
Rank 1
answered on 01 Oct 2014, 02:30 PM
Hi Alex,

I'm still having a few problems with this - it seems that it is not dataSource.read() which directly causes the crash, but the result returned from the server and passed into the scheduler through the datasource. I.e. the point at which the scheduler decides to process the result of the dataSource.read(). This distinction is important because there is always a lag between calling read() and getting the result, and during this time the user could be moving an event, which would cause the crash.

Can you think of anything I can do to mitigate this?

Cheers, Paul.
0
Alexander Popov
Telerik team
answered on 03 Oct 2014, 08:17 AM
Hello Paul,

In that case you could use the DataSource's requestStart and requestEnd event handlers to raise/lower a flag and based on its state - prevent the dragging by calling the e.preventDefault method in the Scheduler's moveStart event handler.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Scheduler
Asked by
Paul
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Paul
Top achievements
Rank 1
Share this question
or