I ended up using jstree. It does everything I need and more. The documentation is tricky to follow, but I has many users out there.
Basically all you do to make your tr (or any foreign element) draggable to tree nodes is to set class="jstree-draggable" on the element. The tree view is then initialised like this.
$("#projectTree").jstree({
"plugins": ["themes", "html_data", "ui", "hotkeys", "dnd", "crrm"],
"animation": 100,
"ui": {
"select_limit": 1
},
// this is the only way I could find to prevent nodes from being dragged.
"crrm": {
"move": {
"check_move": function (m) {
return false;
}
}
},
"dnd": {
"drag_check": function (data) {
// foreign object
var cell = $(data.o);
var row = cell.closest("tr");
// get the list of valid folders this row can be moved to
var canMoveTo = row.data("canmoveto");
// get the folder type
var moveToStatus = $(data.r).data("applicationstatus");
if (canMoveTo.indexOf(moveToStatus) == -1)
return { after: false, before: false, inside: false };
else
return { after: false, before: false, inside: true };
},
"drag_finish": function (data) {
// from foreign object
var cell = $(data.o);
var row = cell.closest("tr");
// to the hovered node
var moveToStatus = $(data.r).data("applicationstatus");
moveRowToStatusFolderConfirm(row, moveToStatus);
//alert("drag_finish");
return true;
}
}
});