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

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

1 Answer 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bert
Top achievements
Rank 1
Bert asked on 29 Feb 2016, 02:21 PM

Hi all,

I tried out this demo to be able to drag rows inside of a grid: http://demos.telerik.com/kendo-ui/sortable/integration-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: http://dojo.telerik.com/oPanI

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

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 02 Mar 2016, 01:49 PM

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")));

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