簡體   English   中英

Kendo Grid可編輯行問題

[英]Kendo Grid editable row issue

我已復制我現在面臨的問題普拉克

我有一個帶有可編輯行的劍道網格。

  1. 單擊編輯,然后單擊“庫存單位”列的值,使警報彈出窗口觸發兩次。
  2. 單擊取消,然后再次單擊同一列,彈出窗口僅打開一次。

為什么會發生這種情況以及如何解決此問題,所以即使該行處於編輯模式,該彈出窗口也只會打開一次。

$scope.grid.options = {
dataSource: $scope.dataSource,
pageable: true,
height: 550,
toolbar: ["create"],
columns: [
    "ProductName",
    { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "120px" },
    { field: "UnitsInStock", title:"Units In Stock", width: "120px", template: '<a href="" ng-click="test(dataItem.UnitsInStock)">{{dataItem.UnitsInStock}}</a>'},
    { field: "Discontinued", width: "120px" },
    { command: ["edit", "destroy"], title: "&nbsp;", width: "250px" }],
editable: "inline"
};

觀察者的行為是由以下事實引起的:即使該字段不可編輯,當Grid處於內聯編輯模式時,整個編輯行仍會建立,因此click事件處理程序將附加兩次。

最直接的解決方法是在事件數據對象上調用stopImmediatePropagation() 這是相同的jQuery文檔。

看看這個普拉克

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM