|
@@ -203,13 +203,17 @@ export default function () {
|
|
|
/**
|
|
|
* 添加行,并进入编辑状态
|
|
|
* @param record 新行的属性集
|
|
|
- * @param editRowCol 要编辑的列序号
|
|
|
+ * @param editRowCol 要编辑的列序号,或 dataIndex 的名称
|
|
|
*/
|
|
|
appendEditRow(record, editRowCol) {
|
|
|
const records = this.getStore().add(record)
|
|
|
const recNew = records[0]
|
|
|
this.setSelection(records)
|
|
|
|
|
|
+ if (typeof editRowCol === 'string' && editRowCol) {
|
|
|
+ editRowCol = this.columns.findIndex((c) => c.dataIndex === editRowCol)
|
|
|
+ }
|
|
|
+
|
|
|
if (typeof editRowCol === 'number') {
|
|
|
const ce = this.findPlugin('cellediting')
|
|
|
this.editingPlugin = ce
|
|
@@ -439,7 +443,7 @@ export default function () {
|
|
|
}
|
|
|
const oValue = value
|
|
|
if (typeof headers[j].renderer === 'function') {
|
|
|
- try{
|
|
|
+ try {
|
|
|
value = headers[j].renderer(value)
|
|
|
if (!value && value !== 0) {
|
|
|
value = oValue
|