Pārlūkot izejas kodu

grid appendEditRow

luoyifan 3 gadi atpakaļ
vecāks
revīzija
3d7bad2afb
1 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. 11 0
      src/controls/grid.js

+ 11 - 0
src/controls/grid.js

@@ -138,6 +138,17 @@ export default function () {
             me._setDataReal(value)
             me._setDataReal(value)
         },
         },
 
 
+        appendRow(record, editRowCol) {
+            const records = this.add(record)
+            const recNew = records[0]
+            this.setSelection(records)
+            const ce = this.findPlugin('cellediting')
+            this.editingPlugin = ce
+            if (typeof editRowCol === 'number') {
+                ce.startEdit(recNew, editRowCol)
+            }
+        },
+
         _setDataReal(value) {
         _setDataReal(value) {
             const me = this
             const me = this
             me.setStore(new Ext.data.Store({
             me.setStore(new Ext.data.Store({