【问题标题】:kendo grid ui editable configuration剑道网格 ui 可编辑配置
【发布时间】:2013-11-11 17:18:54
【问题描述】:

我只想问是否有人知道如何在按钮单击时将剑道网格设置为可编辑的真或假。?如果设置为 false,我可以将网格设置为可编辑的 true,但是我无法将其设置回可编辑的 false。非常感谢您的回复。 :)

$('.k-grid-add').on('click',function(){
   $("#grid").kendoGrid({
          dataSource: dataSource,
          navigatable: true,
          pageable: true,
          height: 430,
          toolbar: ["create", "save", "cancel"],
          columns: [
              "ProductName", {
              field: "UnitPrice",
              title: "Unit Price",
              format: "{0:c}",
              width: 110
          }, {
              field: "UnitsInStock",
              title: "Units In Stock",
              width: 110
          }, {
              field: "Discontinued",
              width: 110
          }, {
              command: "destroy",
              title: " ",
              width: 90
          }],
          editable: true
      });
});

$('.k-grid-cancel-changes').on('click',function(){
$("#grid").kendoGrid({
          dataSource: dataSource,
          navigatable: true,
          pageable: true,
          height: 430,
          toolbar: ["create", "save", "cancel"],
          columns: [
              "ProductName", {
              field: "UnitPrice",
              title: "Unit Price",
              format: "{0:c}",
              width: 110
          }, {
              field: "UnitsInStock",
              title: "Units In Stock",
              width: 110
          }, {
              field: "Discontinued",
              width: 110
          }, {
              command: "destroy",
              title: " ",
              width: 90
          }],
          editable: false
      });
});

【问题讨论】:

    标签: jquery kendo-grid kendo-asp.net-mvc


    【解决方案1】:

    不支持动态更改网格的可编辑选项。

    您需要使用新设置重新初始化整个网格。

    或者您将必须创建基于您的条件的模板列,该列显示一个将行置于编辑模式的按钮(调用 Grid 的 editRow 方法)。 this 主题中介绍了条件逻辑以及如何执行它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-22
      • 2023-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多