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

How to do drag and drop with selected rows in a grid?

1 Answer 294 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Numan
Top achievements
Rank 1
Numan asked on 17 Jan 2012, 11:10 PM
I have a selectable grid and I want to be able to drag the selected row into a drop target.

I tried attaching kendoDraggable on all the grid rows to make all the rows draggle something like this:

$("#grid tr").kendoDraggable({
hint: function() {
var g = $("#grid").data("kendoGrid")
return g.select().clone()
},
dragstart: function() { console.log("drag start");},
dragend: function() {console.log("drag end");}
});

Unfortunately, this doesn't work. What I am doing wrong?

1 Answer, 1 is accepted

Sort by
0
Numan
Top achievements
Rank 1
answered on 17 Jan 2012, 11:15 PM
Answering my own question.

Looks like I needed to use "filter" in the config object. Works now :)

$("#grid").kendoDraggable({
filter: "tr",
hint: function() {
var g = $("#grid").data("kendoGrid")
return g.select().clone()
},
dragstart: function() { console.log("drag start");},
dragend: function() {console.log("drag end");}
});
Tags
Grid
Asked by
Numan
Top achievements
Rank 1
Answers by
Numan
Top achievements
Rank 1
Share this question
or