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