如何在JsGrid中自定义编辑事件 [英] How to customize edit event in JsGrid

查看:456
本文介绍了如何在JsGrid中自定义编辑事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jsGrid ,想知道是否可以自定义editButton的onclick事件.基本上,执行类似显示模式而不是内联编辑的操作.我知道我们可以像这样获得控制列的HTML输出:

I'm using jsGrid and wanna know if it's possible how to customize onclick event of editButton. Basically, doing something like displaying modal instead of inline editing. I know that we can get the HTML output of control column like this :

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

但是如何控制EditButton?感谢您的帮助.

But how to have control on EditButton ? Thanks for your help.

推荐答案

您可以尝试以下操作:

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

在您的jsGrid配置中.

at your jsGrid config.

// I modify this行外的所有行都是jsGrid原始来源的默认行,因此请勿更改它们.

All lines except line // I modify this are default from original source of jsGrid, so dont change them.

这篇关于如何在JsGrid中自定义编辑事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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