[英]In a Kendo Grid, how I do disable dragging while doing an inline edit?
我有一個劍道網格,它帶有可拖動的附件,可以重新排序網格行。
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" });
}
}
});
我還可以通過設置來進行內聯編輯
editable: "inline"
和
{
command: ["edit"]
}
但是,在嘗試單擊可編輯字段時啟用了拖動功能時,Kendo網格會做一些固定的操作。 當我注釋掉kendoDraggable代碼時,編輯工作就很好了。 我正在尋找一種捕獲kendoGrid“ edit”命令並使用它來禁用可拖動性的方法。 當然,在用戶離開嵌入式編輯模式后,我需要重新啟用拖動。
有什么想法嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.