rem: Ext.grid.RowSelectionModel=function(_1){Ext.apply(this,_1);this.selections=new Ext.util.MixedCollection(false,function(o){return o.id;});this.last=false;this.lastActive=false;this.addEvents({"selectionchange":true,"beforerowselect":true,"rowselect":true,"rowdeselect":true});this.locked=false;};Ext.extend(Ext.grid.RowSelectionModel,Ext.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("mousedown",this.handleMouseDown,this);}else{this.grid.on("rowclick",function(_3,_4,e){if(e.button===0&&!e.shiftKey&&!e.ctrlKey){this.selectRow(_4,false);_3.view.focusRow(_4);}},this);}this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{"up":function(e){if(!e.shiftKey){this.selectPrevious(e.shiftKey);}else{if(this.last!==false&&this.lastActive!==false){var _7=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive);if(_7!==false){this.last=_7;}}else{this.selectFirstRow();}}},"down":function(e){if(!e.shiftKey){this.selectNext(e.shiftKey);}else{if(this.last!==false&&this.lastActive!==false){var _9=this.last;this.selectRange(this.last,this.lastActive+1);this.grid.getView().focusRow(this.lastActive);if(_9!==false){this.last=_9;}}else{this.selectFirstRow();}}},scope:this});var _a=this.grid.view;_a.on("refresh",this.onRefresh,this);_a.on("rowupdated",this.onRowUpdated,this);_a.on("rowremoved",this.onRemove,this);},onRefresh:function(){var ds=this.grid.dataSource,i,v=this.grid.view;var s=this.selections;s.each(function(r){if((i=ds.indexOfId(r.id))!=-1){v.onRowSelect(i);}else{s.remove(r);}});},onRemove:function(v,_11,r){this.selections.remove(r);},onRowUpdated:function(v,_14,r){if(this.isSelected(r)){v.onRowSelect(_14);}},selectRecords:function(_16,_17){if(!_17){this.clearSelections();}var ds=this.grid.dataSource;for(var i=0,len=_16.length;i<len;i++){this.selectRow(ds.indexOf(_16[i]),true);}},getCount:function(){return this.selections.length;},selectFirstRow:function(){this.selectRow(0);},selectLastRow:function(_1b){this.selectRow(this.grid.dataSource.getCount()-1,_1b);},selectNext:function(_1c){if(this.last!==false&&(this.last+1)<this.grid.dataSource.getCount()){this.selectRow(this.last+1,_1c);this.grid.getView().focusRow(this.last);}},selectPrevious:function(_1d){if(this.last){this.selectRow(this.last-1,_1d);this.grid.getView().focusRow(this.last);}},getSelections:function(){return[].concat(this.selections.items);},getSelected:function(){return this.selections.itemAt(0);},clearSelections:function(_1e){if(this.locked){return;}if(_1e!==true){var ds=this.grid.dataSource;var s=this.selections;s.each(function(r){this.deselectRow(ds.indexOfId(r.id));},this);s.clear();}else{this.selections.clear();}this.last=false;},selectAll:function(){if(this.locked){return;}this.selections.clear();for(var i=0,len=this.grid.dataSource.getCount();i<len;i++){this.selectRow(i,true);}},hasSelection:function(){return this.selections.length>0;},isSelected:function(_24){var r=typeof _24=="number"?this.grid.dataSource.getAt(_24):_24;return(r&&this.selections.key(r.id)?true:false);},isIdSelected:function(id){return(this.selections.key(id)?true:false);},handleMouseDown:function(e,t){var _29=this.grid.getView(),_2a;if(this.isLocked()||(_2a=_29.findRowIndex(t))===false){return;}if(e.shiftKey&&this.last!==false){var _2b=this.last;this.selectRange(_2b,_2a,e.ctrlKey);this.last=_2b;_29.focusRow(_2a);}else{var _2c=this.isSelected(_2a);if(e.button!=0&&_2c){_29.focusRow(_2a);}else{if(e.ctrlKey&&_2c){this.deselectRow(_2a);}else{this.selectRow(_2a,e.button==0&&(e.ctrlKey||e.shiftKey));_29.focusRow(_2a);}}}},selectRows:function(_2d,_2e){if(!_2e){this.clearSelections();}for(var i=0,len=_2d.length;i<len;i++){this.selectRow(_2d[i],true);}},selectRange:function(_31,_32,_33){if(this.locked){return;}if(!_33){this.clearSelections();}if(_31<=_32){for(var i=_31;i<=_32;i++){this.selectRow(i,true);}}else{for(var i=_31;i>=_32;i--){this.selectRow(i,true);}}},deselectRange:function(_35,_36,_37){if(this.locked){return;}for(var i=_35;i<=_36;i++){this.deselectRow(i,_37);}},selectRow:function(_39,_3a,_3b){if(this.locked||(_39<0||_39>=this.grid.dataSource.getCount())){return;}if(this.fireEvent("beforerowselect",this,_39,_3a)!==false){if(!_3a||this.singleSelect){this.clearSelections();}var r=this.grid.dataSource.getAt(_39);this.selections.add(r);this.last=this.lastActive=_39;if(!_3b){this.grid.getView().onRowSelect(_39);}this.fireEvent("rowselect",this,_39,r);this.fireEvent("selectionchange",this);}},deselectRow:function(_3d,_3e){if(this.locked){return;}if(this.last==_3d){this.last=false;}if(this.lastActive==_3d){this.lastActive=false;}var r=this.grid.dataSource.getAt(_3d);this.selections.remove(r);if(!_3e){this.grid.getView().onRowDeselect(_3d);}this.fireEvent("rowdeselect",this,_3d);this.fireEvent("selectionchange",this);},restoreLast:function(){if(this._last){this.last=this._last;}},acceptsNav:function(row,col,cm){return!cm.isHidden(col)&&cm.isCellEditable(col,row);},onEditorKey:function(_43,e){var k=e.getKey(),_46,g=this.grid,ed=g.activeEditor;if(k==e.TAB){e.stopEvent();ed.completeEdit();if(e.shiftKey){_46=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);}else{_46=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}}else{if(k==e.ENTER&&!e.ctrlKey){e.stopEvent();ed.completeEdit();if(e.shiftKey){_46=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this);}else{_46=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this);}}else{if(k==e.ESC){ed.cancelEdit();}}}if(_46){g.startEditing(_46[0],_46[1]);}}}); 
add: Ext.grid.EditorGrid=function(_1,_2){Ext.grid.EditorGrid.superclass.constructor.call(this,_1,_2);this.getGridEl().addClass("xedit-grid");if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel();}this.activeEditor=null;this.addEvents({"beforeedit":true,"afteredit":true,"validateedit":true});this.on("bodyscroll",this.stopEditing,this);this.on(this.clicksToEdit==1?"cellclick":"celldblclick",this.onCellDblClick,this);};Ext.extend(Ext.grid.EditorGrid,Ext.grid.Grid,{isEditor:true,clicksToEdit:2,trackMouseOver:false,onCellDblClick:function(g,_4,_5){this.startEditing(_4,_5);},onEditComplete:function(ed,_7,_8){this.editing=false;this.activeEditor=null;ed.un("specialkey",this.selModel.onEditorKey,this.selModel);if(String(_7)!=String(_8)){var r=ed.record;var _a=this.colModel.getDataIndex(ed.col);var e={grid:this,record:r,field:_a,originalValue:_8,value:_7,row:ed.row,column:ed.col,cancel:false};if(this.fireEvent("validateedit",e)!==false&&!e.cancel){r.set(_a,e.value);delete e.cancel;this.fireEvent("afteredit",e);}}this.view.focusCell(ed.row,ed.col);},startEditing:function(_c,_d){this.stopEditing();if(this.colModel.isCellEditable(_d,_c)){this.view.ensureVisible(_c,_d,true);var r=this.dataSource.getAt(_c);var _f=this.colModel.getDataIndex(_d);var e={grid:this,record:r,field:_f,value:r.data[_f],row:_c,column:_d,cancel:false};if(this.fireEvent("beforeedit",e)!==false&&!e.cancel){this.editing=true;var ed=this.colModel.getCellEditor(_d,_c);if(!ed.rendered){ed.render(ed.parentEl||document.body);}(function(){ed.row=_c;ed.col=_d;ed.record=r;ed.on("complete",this.onEditComplete,this,{single:true});ed.on("specialkey",this.selModel.onEditorKey,this.selModel);this.activeEditor=ed;var v=r.data[_f];ed.startEdit(this.view.getCell(_c,_d),v);}).defer(50,this);}}},stopEditing:function(){if(this.activeEditor){this.activeEditor.completeEdit();}this.activeEditor=null;}}); 
context: Ext.grid.RowSelectionModel=function(_1){Ext.apply(this,_1);this.selections=new Ext.util.MixedCollection(false,function(o){return o.id;});this.last=false;this.lastActive=false;this.addEvents({"selectionchange":true,"beforerowselect":true,"rowselect":true,"rowdeselect":true});this.locked=false;};Ext.extend(Ext.grid.RowSelectionModel,Ext.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("mousedown",this.handleMouseDown,this);}else{this.grid.on("rowclick",function(_3,_4,e){if(e.button===0&&!e.shiftKey&&!e.ctrlKey){this.selectRow(_4,false);_3.view.focusRow(_4);}},this);}this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{"up":function(e){if(!e.shiftKey){this.selectPrevious(e.shiftKey);}else{if(this.last!==false&&this.lastActive!==false){var _7=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive);if(_7!==false){this.last=_7;}}else{this.selectFirstRow();}}},"down":function(e){if(!e.shiftKey){this.selectNext(e.shiftKey);}else{if(this.last!==false&&this.lastActive!==false){var _9=this.last;this.selectRange(this.last,this.lastActive+1);this.grid.getView().focusRow(this.lastActive);if(_9!==false){this.last=_9;}}else{this.selectFirstRow();}}},scope:this});var _a=this.grid.view;_a.on("refresh",this.onRefresh,this);_a.on("rowupdated",this.onRowUpdated,this);_a.on("rowremoved",this.onRemove,this);},onRefresh:function(){var ds=this.grid.dataSource,i,v=this.grid.view;var s=this.selections;s.each(function(r){if((i=ds.indexOfId(r.id))!=-1){v.onRowSelect(i);}else{s.remove(r);}});},onRemove:function(v,_11,r){this.selections.remove(r);},onRowUpdated:function(v,_14,r){if(this.isSelected(r)){v.onRowSelect(_14);}},selectRecords:function(_16,_17){if(!_17){this.clearSelections();}var ds=this.grid.dataSource;for(var i=0,len=_16.length;i<len;i++){this.selectRow(ds.indexOf(_16[i]),true);}},getCount:function(){return this.selections.length;},selectFirstRow:function(){this.selectRow(0);},selectLastRow:function(_1b){this.selectRow(this.grid.dataSource.getCount()-1,_1b);},selectNext:function(_1c){if(this.last!==false&&(this.last+1)<this.grid.dataSource.getCount()){this.selectRow(this.last+1,_1c);this.grid.getView().focusRow(this.last);}},selectPrevious:function(_1d){if(this.last){this.selectRow(this.last-1,_1d);this.grid.getView().focusRow(this.last);}},getSelections:function(){return[].concat(this.selections.items);},getSelected:function(){return this.selections.itemAt(0);},clearSelections:function(_1e){if(this.locked){return;}if(_1e!==true){var ds=this.grid.dataSource;var s=this.selections;s.each(function(r){this.deselectRow(ds.indexOfId(r.id));},this);s.clear();}else{this.selections.clear();}this.last=false;},selectAll:function(){if(this.locked){return;}this.selections.clear();for(var i=0,len=this.grid.dataSource.getCount();i<len;i++){this.selectRow(i,true);}},hasSelection:function(){return this.selections.length>0;},isSelected:function(_24){var r=typeof _24=="number"?this.grid.dataSource.getAt(_24):_24;return(r&&this.selections.key(r.id)?true:false);},isIdSelected:function(id){return(this.selections.key(id)?true:false);},handleMouseDown:function(e,t){var _29=this.grid.getView(),_2a;if(this.isLocked()||(_2a=_29.findRowIndex(t))===false){return;}if(e.shiftKey&&this.last!==false){var _2b=this.last;this.selectRange(_2b,_2a,e.ctrlKey);this.last=_2b;_29.focusRow(_2a);}else{var _2c=this.isSelected(_2a);if(e.button!=0&&_2c){_29.focusRow(_2a);}else{if(e.ctrlKey&&_2c){this.deselectRow(_2a);}else{this.selectRow(_2a,e.button==0&&(e.ctrlKey||e.shiftKey));_29.focusRow(_2a);}}}},selectRows:function(_2d,_2e){if(!_2e){this.clearSelections();}for(var i=0,len=_2d.length;i<len;i++){this.selectRow(_2d[i],true);}},selectRange:function(_31,_32,_33){if(this.locked){return;}if(!_33){this.clearSelections();}if(_31<=_32){for(var i=_31;i<=_32;i++){this.selectRow(i,true);}}else{for(var i=_31;i>=_32;i--){this.selectRow(i,true);}}},deselectRange:function(_35,_36,_37){if(this.locked){return;}for(var i=_35;i<=_36;i++){this.deselectRow(i,_37);}},selectRow:function(_39,_3a,_3b){if(this.locked||(_39<0||_39>=this.grid.dataSource.getCount())){return;}if(this.fireEvent("beforerowselect",this,_39,_3a)!==false){if(!_3a||this.singleSelect){this.clearSelections();}var r=this.grid.dataSource.getAt(_39);this.selections.add(r);this.last=this.lastActive=_39;if(!_3b){this.grid.getView().onRowSelect(_39);}this.fireEvent("rowselect",this,_39,r);this.fireEvent("selectionchange",this);}},deselectRow:function(_3d,_3e){if(this.locked){return;}if(this.last==_3d){this.last=false;}if(this.lastActive==_3d){this.lastActive=false;}var r=this.grid.dataSource.getAt(_3d);this.selections.remove(r);if(!_3e){this.grid.getView().onRowDeselect(_3d);}this.fireEvent("rowdeselect",this,_3d);this.fireEvent("selectionchange",this);},restoreLast:function(){if(this._last){this.last=this._last;}},acceptsNav:function(row,col,cm){return!cm.isHidden(col)&&cm.isCellEditable(col,row);},onEditorKey:function(_43,e){var k=e.getKey(),_46,g=this.grid,ed=g.activeEditor;if(k==e.TAB){e.stopEvent();ed.completeEdit();if(e.shiftKey){_46=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);}else{_46=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}}else{if(k==e.ENTER&&!e.ctrlKey){e.stopEvent();ed.completeEdit();if(e.shiftKey){_46=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this);}else{_46=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this);}}else{if(k==e.ESC){ed.cancelEdit();}}}if(_46){g.startEditing(_46[0],_46[1]);}}});
meta: 5269	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5269/d6279c93dfac928173a95baee130443f46f50eb4/jsOut.js/buggy/Animator/dev/tmp/jsOut.js