admin管理员组文章数量:1415484
I've got a kendo grid with a draggable attached to it to allow reordering of grid rows.
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.kendoDropTarget({
group: "gridGroup",
drop: function (e) {
e.draggable.hint.hide();
var target = dataSource.getByUid($(e.draggable.currentTarget).data("uid")),
dest = $(document.elementFromPoint(e.clientX, e.clientY));
if (dest.is("th")) {
return;
}
dest = dataSource.getByUid(dest.parent().data("uid"));
if (target.get("Id") !== dest.get("Id")) {
var tmp = target.Priority;
target.Priority = dest.Priority;
dest.Priority = tmp;
dataSource.sort({ field: "Priority", dir: "asc" });
}
}
});
I also have the ability to do inline edits by setting
editable: "inline"
and
{
mand: ["edit"]
}
However, Kendo grid does some screwing things when dragging is enabled while trying to click on an editable field. When I ment out the kendoDraggable code, editing works just fine. I'm looking for a way of capturing the kendoGrid "edit" mand and using that to disable the draggability. Of course, I'd need to re-enable dragging after the user leaves inline editing mode.
Any thoughts?
I've got a kendo grid with a draggable attached to it to allow reordering of grid rows.
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.kendoDropTarget({
group: "gridGroup",
drop: function (e) {
e.draggable.hint.hide();
var target = dataSource.getByUid($(e.draggable.currentTarget).data("uid")),
dest = $(document.elementFromPoint(e.clientX, e.clientY));
if (dest.is("th")) {
return;
}
dest = dataSource.getByUid(dest.parent().data("uid"));
if (target.get("Id") !== dest.get("Id")) {
var tmp = target.Priority;
target.Priority = dest.Priority;
dest.Priority = tmp;
dataSource.sort({ field: "Priority", dir: "asc" });
}
}
});
I also have the ability to do inline edits by setting
editable: "inline"
and
{
mand: ["edit"]
}
However, Kendo grid does some screwing things when dragging is enabled while trying to click on an editable field. When I ment out the kendoDraggable code, editing works just fine. I'm looking for a way of capturing the kendoGrid "edit" mand and using that to disable the draggability. Of course, I'd need to re-enable dragging after the user leaves inline editing mode.
Any thoughts?
Share Improve this question asked Feb 27, 2013 at 15:03 jermnyjermny 8802 gold badges12 silver badges23 bronze badges1 Answer
Reset to default 7You can just make the filter to exclude a row which is being currently edited.
grid.table.kendoDraggable({
filter: "tbody > tr:not(.k-grid-edit-row)",
Here is live example.
本文标签: javascriptIn a kendo gridhow I do disable dragging while doing an inline editStack Overflow
版权声明:本文标题:javascript - In a Kendo Grid, how I do disable dragging while doing an inline edit? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745232597a2648891.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论