Happy-Coding-Clans / vue-easytable

A powerful data table based on vuejs. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.
https://happy-coding-clans.github.io/vue-easytable/
MIT License
3.69k stars 738 forks source link

[Feature Request] 增加进入编辑模式前的方法回调 #556

Closed tiantianchuangduixiang closed 1 year ago

tiantianchuangduixiang commented 1 year ago

选择要提交 issue 的库

vue-easytable

Issue 类型

Feature

Issue 标题

增加进入编辑模式前的方法回调

这个功能解决了什么问题?

解决特定的单元格在一些场景内需禁止编辑 不能出现编辑框

你期望的 API 是什么样的?

let currentRow = this.tableData.find( (x) => x[rowKeyFieldName] === rowKey, ); const currentColumn = colgroups.find( (x) => x.key === colKey, ); const changeValue = editingCell.row[currentColumn.field]; let { editCellByDblClickBefore } = editOption let isEdit = true if (isFunction(editCellByDblClickBefore)) { isEdit = editCellByDblClickBefore({ row: cloneDeep(currentRow), column: currentColumn, changeValue, }) }

可以继续按照 目前的 editOption 这个方法进行添加回调 目前 我在ve-table->index.jsx-> editCellByClick中 增加了 该内容

huangshuwei commented 1 year ago

已支持: https://github.com/Happy-Coding-Clans/vue-easytable/releases/tag/v2.25.0