2 つのグリッドがあります。私はそれらを子グリッドと親グリッドと呼んでいます。親グリッドに新しい行 (データ) を追加するときに、親グリッドをリロードします。コードで afteredit 関数を使用して編集しようとしていました。アラートの 2 行目のコメントを外すと、問題なく動作します。ただし、アラートがないと、新しく追加された行は非表示になります。私のコードで何が問題なのかわかりません。新しい行をグリッドに追加した後、グリッドをすぐにリロードする方法を教えてください。
これは私のアフターエディット機能です
   afteredit : function (roweditor, changes, record, rowIndex) 
   { //alert('alert me');
      if (!roweditor.initialized) {
         roweditor.initFields();
      }
      var fields = roweditor.items.items;
      // Disable key fields if its not a new row
      Ext.each(fields, function (field, i) {
         field.setReadOnly(false);
         field.removeClass('x-item-disabled');
      });
        this.grid.getSelectionModel().selectRow(0);
        this.grid.getView().refresh();
   },
xt.ux.grid.woerp = 
{
   configRowEditor: 
   {
      saveText: "Save",
      cancelText: "Cancel",
      commitChangesText: WOERP.constants.gridCommitChanges,
      errorText: 'Errors',
      listeners: 
      {
         beforeedit: WOERP.grid.handler.beforeedit,
         validateedit: WOERP.grid.handler.validateedit,
         canceledit: WOERP.grid.handler.canceledit,
         afteredit: WOERP.grid.handler.afteredit,
         aftershow: WOERP.grid.handler.aftershow,
         move: WOERP.grid.handler.resize,
         hide: function (p) 
         {
            var mainBody = this.grid.getView().mainBody;
            if (typeof mainBody != 'undefined') 
            {
               var lastRow = Ext.fly(this.grid.getView().getRow(this.grid.getStore().getCount() - 1));
               if (lastRow != null) 
               {
                  mainBody.setHeight(lastRow.getBottom() - mainBody.getTop(), 
                  {
                     callback: function () 
                     {
                        mainBody.setHeight('auto');
                     }
                  });
               }
            }
         },
         afterlayout: WOERP.grid.handler.resize
     }
   },