如题!在EditorGridPanel编辑单元格的时候,举例,我当前双击了Cell(5,6)//第5行,第6列,编辑完(编辑控件还没有失去焦点的),鼠标点到了Cell(4,6),结果发现,Cell(4,6)的值跟着变成了Cell(5,6)的值,错位了,郁闷,发现这个问题在网上提到的很少,CSDN上好像又一个,但是没有解答!求教于各位达人!!!!
谢谢!!!

解决方案 »

  1.   


    var editor_text = new Ext.form.TextField();
                    var grid = new Ext.grid.EditorGridPanel({
                        frame: true,
                        columnLines: true, containerScroll: true, autoScroll: true,
                        layout: "fit", store: m1.store,
                        sm: new Ext.grid.RowSelectionModel(),
                        cm: new Ext.grid.ColumnModel([
                                new Ext.grid.RowNumberer(), 
                                { header: "姓名", dataIndex: "Name", width: 60, editor: editor_text, sortable: true },                             { header: "身份证号码", dataIndex: "IDCard", editor: editor_text, width: 140, sortable: true } 
     
                            ]),
     
                        listeners: {
                            "rowclick": function(grid, rowIndex, e) {
                                if (grid.rowIndex == rowIndex) return;
                                grid.rowIndex = rowIndex;
                                var r = grid.store.getAt(rowIndex);
                                m1.locate(r.id);
                            } 
                        } 
                    });
      

  2.   

    问题已经找到(不是特别确定).主要是rowclick事件中,我重新定位store的当前行,然后在afteredit中就会更新行,而更新的行变成了rowclick的行,所以出错.
    要是ext中事件处理顺序为: afteredit->rowclick就好了.我在这里的处理办法是: 在rowclick中加上: grid.stopEditing().搞定
      

  3.   

    ? RowNumberer 错误? 我好像还没有遇到过