Grid sortable (dragging) doesn't function when kendo.ns = 'kendo-'

2 posts, 0 answers
  1. Bert
    Bert avatar
    3 posts
    Member since:
    Feb 2016

    Posted 29 Feb 2016 Link to this post

    Hi all,

    I tried out this demo to be able to drag rows inside of a grid:

    It works great unless the following line is added in javascript:

    kendo.ns = "kendo-";

    If "kendo.ns is" set than you can only change 1 row before the console prints this error: "Uncaught TypeError: Cannot read property 'uid' of undefined". And you can no longer drag any row after that one time.

    Here is an example:

    Our project doesn't allow for this line to be removed, is there still a way to keep this drag functionality somehow?

  2. Rosen
    Rosen avatar
    3253 posts

    Posted 02 Mar 2016 Link to this post

    Hello Bert,

    The error is caused by the fact that the demo code is accessing a data attribute. When the kendo.ns is set, the data attributes rendered by the widgets will be prefixed with the value of the kendo.ns, thus this code will not work. You should instead modify the code to access the attribute using the correct prefix:

    dataItem = grid.dataSource.getByUid(e.item.attr(kendo.attr("uid")));

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top