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

4 posts, 0 answers
  1. Paul
    Paul avatar
    24 posts
    Member since:
    Aug 2013

    Posted 19 Sep 2014 Link to this post

    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.
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1442 posts

    Posted 23 Sep 2014 Link to this post

    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!
     
  3. Paul
    Paul avatar
    24 posts
    Member since:
    Aug 2013

    Posted 01 Oct 2014 in reply to Alexander Popov Link to this post

    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.
  4. Alexander Popov
    Admin
    Alexander Popov avatar
    1442 posts

    Posted 03 Oct 2014 Link to this post

    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!
     
Back to Top