PDA

View Full Version : EditorGrid Single Selection Model bug?



coltsfan2k
23 Mar 2007, 3:59 PM
I'm working with version 1.0 alpha2 using an EditorGrid with a RowSelectionModel set to singleSelect as such


var selModel = new Ext.grid.RowSelectionModel({singleSelect:true});

Each row in the grid represents an entity even though you can only edit one cell at a time, so it is desirable to have the entire row selected. When I'm editing a cell and hit enter the next cell below becomes editable. This works great, however the previous row remains selected. Is this a bug or do I need to manage the selection of the row below?

The function below is defined in RowSelectionModel


onEditorKey : function(field, e){
var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
if(k == e.TAB){
if(e.shiftKey){
newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
}else{
newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
}
e.stopEvent();
}else if(k == e.ENTER && !e.ctrlKey){
if(e.shiftKey){
newCell = g.walkCells(ed.row-1, ed.col, -1, this.acceptsNav, this);
}else{
debugger;
newCell = g.walkCells(ed.row+1, ed.col, 1, this.acceptsNav, this);
}
e.stopEvent();
}else if(k == e.ESC){
ed.cancelEdit();
}
if(newCell){
g.startEditing(newCell[0], newCell[1]);
}
}


Right after my debugger statement newCell is assigned with what appear to be the appropriate values, so all seems to be ok.

Any thoughts?

Thanks in advance.
Coltsfan2k

JeffHowden
23 Mar 2007, 4:17 PM
The current release is alpha 3, rev 4. Start by updating to that and see if the problem persists.