如何在JsGrid中自定义编辑事件

How to customize edit event in JsGrid

本文关键字:自定义 编辑 事件 JsGrid      更新时间:2023-09-26

我正在使用jsGrid,想知道是否有可能如何自定义editButtononclick事件。基本上,做一些像显示模态而不是内联编辑的事情。我知道我们可以像这样得到控制列的HTML输出:

{
    type: 'control',
    itemTemplate: function() {
        var $result = jsGrid.fields.control.prototype.itemTemplate.apply(this, arguments); // Array of string
        return $result;
    }
}

但是如何控制EditButton

你可以试试:

editItem: function(item) {
  var $row = this.rowByItem(item);
  if ($row.length) {
    console.log('$row: ' + JSON.stringify($row)); // I modify this
    this._editRow($row);
  }
},

在你的jsGrid配置。

// I modify this行外的所有行都是jsGrid原始源代码的默认行,所以不要更改