【问题标题】:Kendo Grid editable row issue剑道网格可编辑行问题
【发布时间】:2016-10-14 18:43:13
【问题描述】:

我已经在plunk 中重现了我面临的问题。

我有一个带有可编辑行的剑道网格。

  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"
};

【问题讨论】:

    标签: javascript angularjs kendo-ui telerik kendo-grid


    【解决方案1】:

    观察者行为是由于即使该字段不可编辑,当 Grid 处于内联编辑模式时仍会构建整个编辑行,因此单击事件处理程序会附加两次。

    最直接的解决方法是在事件数据对象上调用stopImmediatePropagation()。这是相同的jQuery 文档。

    看看这个plunk。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-29
      • 2012-02-14
      • 1970-01-01
      相关资源
      最近更新 更多