简体   繁体   中英

How to customize edit event in JsGrid

I'm using jsGrid and want to 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;
    }
}

But how to have control on EditButton ?

You can try this:

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

at your jsGrid config.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM