extjs editorGrid自动滚动的问题

在ext2.2的可编辑grid中,unfocus一个cell之后,grid的滚动条会自动向右滚动,造成页面混乱

 

解决方法:

在ext-all-debug.js中,找到EditorGridPannel部分代码,注释或者重写focusCell方法

 

// private   
     onEditComplete : function(ed, value, startValue){   
         this.editing = false;   
         this.activeEditor = null;   
         ed.un("specialkey", this.selModel.onEditorKey, this.selModel);   
         var r = ed.record;   
         var field = this.colModel.getDataIndex(ed.col);   
         value = this.postEditValue(value, startValue, r, field);   
         if(String(value) !== String(startValue)){   
             var e = {   
                 grid: this,   
                 record: r,   
                 field: field,   
                 originalValue: startValue,   
                 value: value,   
                 row: ed.row,   
                 column: ed.col,   
                 cancel:false  
             };   
             if(this.fireEvent("validateedit", e) !== false && !e.cancel){   
                 r.set(field, e.value);   
                 delete e.cancel;   
                 this.fireEvent("afteredit", e);   
             }   
         }   
         /*this.view.focusCell(ed.row, ed.col); */
     },
 

 

 

在ext-all.js中,按下面方法注释掉focusCell方法

 

delete g.cancel;this.fireEvent("afteredit",g)}}/*this.view.focusCell(b.row,b.col)*/
 

 

你可能感兴趣的:(ext)