Skip to content

Commit 8fdbc2c

Browse files
chieveitJared Kirschner
authored andcommitted
better disable editing
1 parent 4c37e93 commit 8fdbc2c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/component/editor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ export default class Editor {
249249
}
250250

251251
setCell(cell, validator) {
252+
if (cell && cell.editable === false) return;
253+
252254
// console.log('::', validator);
253255
const { el, datepicker, suggest } = this;
254256
el.show();

src/core/row.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ class Rows {
106106

107107
setCellText(ri, ci, text) {
108108
const cell = this.getCellOrNew(ri, ci);
109+
if (cell.editable === false) return;
109110
cell.text = text;
110111
}
111112

112113
// what: all | format | text
113-
copyPaste(srcCellRange, dstCellRange, what, autofill = false, cb = () => {}) {
114+
copyPaste(srcCellRange, dstCellRange, what, autofill = false, cb = () => { }) {
114115
const {
115116
sri, sci, eri, eci,
116117
} = srcCellRange;

0 commit comments

Comments
 (0)