Rename editing as getEditor
This commit is contained in:
parent
e41e6ad386
commit
a1ae31c858
@ -70,7 +70,7 @@
|
||||
takeAvailableSpace: false,
|
||||
columns,
|
||||
data,
|
||||
editing(colIndex, rowIndex, value, parent) {
|
||||
getEditor(colIndex, rowIndex, value, parent) {
|
||||
// editing obj only for date field
|
||||
if (colIndex != 6) return;
|
||||
|
||||
|
||||
@ -2569,12 +2569,12 @@ var CellManager = function () {
|
||||
var $editCell = (0, _dom2.default)('.edit-cell', $cell);
|
||||
$editCell.innerHTML = '';
|
||||
|
||||
var editing = this.getEditingObject(colIndex, rowIndex, cell.content, $editCell);
|
||||
var editor = this.getEditor(colIndex, rowIndex, cell.content, $editCell);
|
||||
|
||||
if (editing) {
|
||||
this.currentCellEditing = editing;
|
||||
if (editor) {
|
||||
this.currentCellEditor = editor;
|
||||
// initialize editing input with cell value
|
||||
editing.initValue(cell.content, rowIndex, col);
|
||||
editor.initValue(cell.content, rowIndex, col);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
@ -2588,10 +2588,10 @@ var CellManager = function () {
|
||||
this.$editingCell = null;
|
||||
}
|
||||
}, {
|
||||
key: 'getEditingObject',
|
||||
value: function getEditingObject(colIndex, rowIndex, value, parent) {
|
||||
key: 'getEditor',
|
||||
value: function getEditor(colIndex, rowIndex, value, parent) {
|
||||
// debugger;
|
||||
var obj = this.options.editing(colIndex, rowIndex, value, parent);
|
||||
var obj = this.options.getEditor(colIndex, rowIndex, value, parent);
|
||||
if (obj && obj.setValue) return obj;
|
||||
|
||||
// editing fallback
|
||||
@ -2628,11 +2628,11 @@ var CellManager = function () {
|
||||
var col = this.datamanager.getColumn(colIndex);
|
||||
|
||||
if ($cell) {
|
||||
var editing = this.currentCellEditing;
|
||||
var editor = this.currentCellEditor;
|
||||
|
||||
if (editing) {
|
||||
var value = editing.getValue();
|
||||
var done = editing.setValue(value, rowIndex, col);
|
||||
if (editor) {
|
||||
var value = editor.getValue();
|
||||
var done = editor.setValue(value, rowIndex, col);
|
||||
var oldValue = this.getCell(colIndex, rowIndex).content;
|
||||
|
||||
// update cell immediately
|
||||
@ -2649,7 +2649,7 @@ var CellManager = function () {
|
||||
}
|
||||
}
|
||||
|
||||
this.currentCellEditing = null;
|
||||
this.currentCellEditor = null;
|
||||
}
|
||||
}, {
|
||||
key: 'copyCellContents',
|
||||
@ -3378,7 +3378,7 @@ exports.default = {
|
||||
none: ''
|
||||
},
|
||||
freezeMessage: '',
|
||||
editing: function editing() {},
|
||||
getEditor: function getEditor() {},
|
||||
addSerialNoColumn: true,
|
||||
addCheckboxColumn: false,
|
||||
enableClusterize: true,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -353,12 +353,12 @@ export default class CellManager {
|
||||
const $editCell = $('.edit-cell', $cell);
|
||||
$editCell.innerHTML = '';
|
||||
|
||||
const editing = this.getEditingObject(colIndex, rowIndex, cell.content, $editCell);
|
||||
const editor = this.getEditor(colIndex, rowIndex, cell.content, $editCell);
|
||||
|
||||
if (editing) {
|
||||
this.currentCellEditing = editing;
|
||||
if (editor) {
|
||||
this.currentCellEditor = editor;
|
||||
// initialize editing input with cell value
|
||||
editing.initValue(cell.content, rowIndex, col);
|
||||
editor.initValue(cell.content, rowIndex, col);
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,9 +371,9 @@ export default class CellManager {
|
||||
this.$editingCell = null;
|
||||
}
|
||||
|
||||
getEditingObject(colIndex, rowIndex, value, parent) {
|
||||
getEditor(colIndex, rowIndex, value, parent) {
|
||||
// debugger;
|
||||
const obj = this.options.editing(colIndex, rowIndex, value, parent);
|
||||
const obj = this.options.getEditor(colIndex, rowIndex, value, parent);
|
||||
if (obj && obj.setValue) return obj;
|
||||
|
||||
// editing fallback
|
||||
@ -403,11 +403,11 @@ export default class CellManager {
|
||||
const col = this.datamanager.getColumn(colIndex);
|
||||
|
||||
if ($cell) {
|
||||
const editing = this.currentCellEditing;
|
||||
const editor = this.currentCellEditor;
|
||||
|
||||
if (editing) {
|
||||
const value = editing.getValue();
|
||||
const done = editing.setValue(value, rowIndex, col);
|
||||
if (editor) {
|
||||
const value = editor.getValue();
|
||||
const done = editor.setValue(value, rowIndex, col);
|
||||
const oldValue = this.getCell(colIndex, rowIndex).content;
|
||||
|
||||
// update cell immediately
|
||||
@ -424,7 +424,7 @@ export default class CellManager {
|
||||
}
|
||||
}
|
||||
|
||||
this.currentCellEditing = null;
|
||||
this.currentCellEditor = null;
|
||||
}
|
||||
|
||||
copyCellContents($cell1, $cell2) {
|
||||
|
||||
@ -39,7 +39,7 @@ export default {
|
||||
none: ''
|
||||
},
|
||||
freezeMessage: '',
|
||||
editing: () => {},
|
||||
getEditor: () => {},
|
||||
addSerialNoColumn: true,
|
||||
addCheckboxColumn: false,
|
||||
enableClusterize: true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user