Hi everybody,
I have this:
[code]
$(document).ready(function()
{
var grid = $("#medicijnenGridVolgorde").data('kendoGrid');
var dataSource = grid.dataSource;
grid.table.kendoDraggable({
filter: "tbody > tr",
group: "gridGroup",
hint: function (e) {
return $('<div class="k-grid k-widget"><table><tbody><tr>' + e.html() + '</tr></tbody></table></div>');
}
});
grid.table/*.find("tbody > tr")*/.kendoDropTarget({
group: "gridGroup",
drop: function (e) {
var target = dataSource.get($(e.draggable.currentTarget).data("id")),
dest = $(e.target);
if (dest.is("th")) {
return;
}
dest = dataSource.get(dest.parent().data("id"));
//not on same item
if (target.get("Id") !== dest.get("id")) {
//reorder the items
var tmp = target.get("Volgorde");
target.set("Volgorde", dest.get("Volgorde"));
dest.set("Volgorde", tmp);
dataSource.sort({ field: "Volgorde", dir: "asc" });
}
}
});
});
[code]
but the target: if (target.get("Id") !== dest.get("id")) {
is the same. So the drop/drag doesnt work.