Kendo Grid 可以一直处于编辑模式吗? [英] Can Kendo Grid be always in edit mode?

查看:27
本文介绍了Kendo Grid 可以一直处于编辑模式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道剑道网格是否可以一直设置为编辑模式?

Does anyone know if the kendo grid could be always set to edit mode at all times?

我们不希望用户单击单元格或按钮来激活编辑模式.我们希望小部件始终显示并可用.

We don't want the user to click on a cell or a button to activate the edit mode. We want it the widgets to be displayed and available at all times.

有可能吗?

推荐答案

除了使用批量编辑模式,您还可以尝试使用 MVVM 设置每列的模板并将输入元素绑定到数据项.

Apart from using batch editing mode you can try setting the template of every column and binding the input elements to the data items using MVVM.

$("#grid").kendoGrid({
  dataSource: {
    schema: {
      model: {
        id: "id",
        fields: {
          id: { editable: false }
        }
      }
    }
    data: [
      { id:1, age: 30, name: "John Doe" }
    ]
  },
  columns: [
    { field: "id", width: 50 },
    { field: "age", template: "<input data-bind='value: age' data-role='numerictextbox'>" },
    { field: "name", template:"<input data-bind='value: name' >" }
  ],
  dataBound: function() {
    var rows = this.tbody.children();
    var dataItems = this.dataSource.view();
    for (var i = 0; i < dataItems.length; i++)  {
      kendo.bind(rows[i], dataItems[i]);
    }
  }
});

这是一个现场演示:http://jsbin.com/ApoFobA/2/edit

这篇关于Kendo Grid 可以一直处于编辑模式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆