X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..92c2b89db26be16707f4a805d3303ab2531006e1:/docs/source/RowSelectionModel.html diff --git a/docs/source/RowSelectionModel.html b/docs/source/RowSelectionModel.html index a3b280a5..07fad07c 100644 --- a/docs/source/RowSelectionModel.html +++ b/docs/source/RowSelectionModel.html @@ -1,5 +1,6 @@
+this
reference) in which the function is executed. Defaults to this RowSelectionModel.
* @return {Boolean} true if all selections were iterated
*/
each : function(fn, scope){
@@ -428,7 +430,7 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel, {
return;
}
var r = this.grid.store.getAt(index);
- if(r && this.fireEvent("beforerowselect", this, index, keepExisting, r) !== false){
+ if(r && this.fireEvent('beforerowselect', this, index, keepExisting, r) !== false){
if(!keepExisting || this.singleSelect){
this.clearSelections();
}
@@ -437,8 +439,8 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel, {
if(!preventViewNotify){
this.grid.getView().onRowSelect(index);
}
- this.fireEvent("rowselect", this, index, r);
- this.fireEvent("selectionchange", this);
+ this.fireEvent('rowselect', this, index, r);
+ this.fireEvent('selectionchange', this);
}
},
@@ -467,8 +469,8 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel, {
if(!preventViewNotify){
this.grid.getView().onRowDeselect(index);
}
- this.fireEvent("rowdeselect", this, index, r);
- this.fireEvent("selectionchange", this);
+ this.fireEvent('rowdeselect', this, index, r);
+ this.fireEvent('selectionchange', this);
}
},
@@ -486,7 +488,12 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel, {
// private
onEditorKey : function(field, e){
- var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
+ var k = e.getKey(),
+ newCell,
+ g = this.grid,
+ last = g.lastEdit,
+ ed = g.activeEditor,
+ ae, last, r, c;
var shift = e.shiftKey;
if(k == e.TAB){
e.stopEvent();
@@ -497,24 +504,34 @@ Ext.extend(Ext.grid.RowSelectionModel, Ext.grid.AbstractSelectionModel, {
newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
}
}else if(k == e.ENTER){
- e.stopEvent();
- ed.completeEdit();
if(this.moveEditorOnEnter !== false){
if(shift){
- newCell = g.walkCells(ed.row - 1, ed.col, -1, this.acceptsNav, this);
+ newCell = g.walkCells(last.row - 1, last.col, -1, this.acceptsNav, this);
}else{
- newCell = g.walkCells(ed.row + 1, ed.col, 1, this.acceptsNav, this);
+ newCell = g.walkCells(last.row + 1, last.col, 1, this.acceptsNav, this);
}
}
- }else if(k == e.ESC){
- ed.cancelEdit();
}
if(newCell){
- g.startEditing(newCell[0], newCell[1]);
+ r = newCell[0];
+ c = newCell[1];
+
+ if(last.row != r){
+ this.selectRow(r); // *** highlight newly-selected cell and update selection
+ }
+
+ if(g.isEditor && g.editing){ // *** handle tabbing while editorgrid is in edit mode
+ ae = g.activeEditor;
+ if(ae && ae.field.triggerBlur){
+ // *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method
+ ae.field.triggerBlur();
+ }
+ }
+ g.startEditing(r, c);
}
},
- destroy: function(){
+ destroy : function(){
if(this.rowNav){
this.rowNav.disable();
this.rowNav = null;