PageRenderTime 49ms CodeModel.GetById 14ms app.highlight 32ms RepoModel.GetById 1ms app.codeStats 0ms

/code/plugins/dhtmlx/dhtmlxGrid/codebase/ext/dhtmlxgrid_keymap_access.js

http://mapapp.googlecode.com/
JavaScript | 49 lines | 34 code | 3 blank | 12 comment | 25 complexity | b7014b17e5a75bdd135ebaa4de2be12d MD5 | raw file
 1//v.2.1 build 90226
 2
 3/*
 4Copyright DHTMLX LTD. http://www.dhtmlx.com
 5You allowed to use this component or parts of it under GPL terms
 6To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com
 7*/
 8
 9dhtmlXGridObject.prototype._key_events={k13_1_0:function(){this.editStop()},
10 k13_0_1:function(){this._key_events.k9_0_1.call(this)
11 },
12 k13_0_0:function(){this._key_events.k9_0_0.call(this)
13 },
14 k9_0_0:function(){this.editStop();var z=this._getNextCell(null,1);if (z){if (this.pagingOn)this.showRow(z.parentNode.idd);this.selectCell(z.parentNode,z._cellIndex,(this.row!=z.parentNode),false,true);this._still_active=true};if (this.editor && this.editor.obj && this.editor.obj.select)this.editor.obj.select()},
15 k9_0_1:function(){this.editStop();var z=this._getNextCell(null,-1);if (z){this.selectCell(z.parentNode,z._cellIndex,(this.row!=z.parentNode),false,true);this._still_active=true};if (this.editor && this.editor.obj)this.editor.obj.select()},
16 k113_0_0:function(){if (this._f2kE)this.editCell()},
17 k32_0_0:function(){var c=this.cells4(this.cell);if (!c.changeState || (c.changeState()===false)) return false},
18 k27_0_0:function(){this.editStop(true)},
19 k33_0_0:function(){if(this.pagingOn)this.changePage(this.currentPage-1);else this.scrollPage(-1)},
20 k34_0_0:function(){if(this.pagingOn)this.changePage(this.currentPage+1);else this.scrollPage(1)},
21 k37_0_0:function(){if (this.editor)return false;if(this.isTreeGrid())
22 this.collapseKids(this.row)
23 else this._key_events.k9_0_1.call(this)},
24 k39_0_0:function(){if (this.editor)return false;if(!this.editor && this.isTreeGrid())
25 this.expandKids(this.row)
26 else this._key_events.k9_0_0.call(this)},
27 k37_1_0:function(){if (this.editor)return false;this.selectCell(this.row,0,false,false,true);if (this.editor && this.editor.obj)this.editor.obj.select()},
28 k39_1_0:function(){if (this.editor)return false;this.selectCell(this.row,this._cCount-1,false,false,true);if (this.editor && this.editor.obj)this.editor.obj.select()}, 
29 k38_1_0:function(){this.selectCell(this.rowsCol[0],this.cell._cellIndex,false,false,true);if (this.editor && this.editor.obj)this.editor.obj.select()},
30 k40_1_0:function(){this.selectCell(this.rowsCol[this.rowsCol.length-1],this.cell._cellIndex,false,false,true);if (this.editor && this.editor.obj)this.editor.obj.select()},
31 k38_0_1:function(){var rowInd = this.row.rowIndex;var nrow=this._nextRow(rowInd-1,-1);if (!nrow || nrow._sRow || nrow._rLoad)return false;this.selectCell(nrow,this.cell._cellIndex,false,false,true);if (this.editor && this.editor.obj)this.editor.obj.select()},
32 k40_0_1:function(){var rowInd = this.row.rowIndex;var nrow=this._nextRow(rowInd-1,1);if (!nrow || nrow._sRow || nrow._rLoad)return false;this.selectCell(nrow,this.cell._cellIndex,false,false,true);if (this.editor && this.editor.obj)this.editor.obj.select()}, 
33 k38_1_1:function(){var rowInd = this.row.rowIndex;for (var i = rowInd - 1;i >= 0;i--){this.selectCell(this.rowsCol[i],this.cell._cellIndex,true,false,true)}},
34 k40_1_1:function(){var rowInd = this.row.rowIndex;for (var i = rowInd;i <this.rowsCol.length;i++){this.selectCell(this.rowsCol[i],this.cell._cellIndex,true,false,true)}}, 
35 k40_0_0:function(){if (this.editor && this.editor.combo)this.editor.shiftNext();else{if (!this.row.idd)return;var rowInd = rowInd=this.getRowIndex(this.row.idd)+1;if (this.rowsBuffer[rowInd]){var nrow=this._nextRow(rowInd-1,1);if (this.pagingOn && nrow)this.showRow(nrow.idd);this._Opera_stop=0;this.selectCell(nrow,this.cell._cellIndex,false,false,true)}else this._key_events.k34_0_0.apply(this,[])};this._still_active=true},
36 k36_0_0:function(){return this._key_events.k37_1_0.call(this)},
37 k35_0_0:function(){return this._key_events.k39_1_0.call(this)}, 
38 k36_1_0:function(){if (this.editor || !this.rowsCol.length)return false;this.selectCell(this.rowsCol[0],0,false,false,true);if (this.editor && this.editor.obj)this.editor.obj.select()},
39 k35_1_0:function(){if (this.editor || !this.rowsCol.length)return false;this.selectCell(this.rowsCol[this.rowsCol.length-1],this._cCount-1,false,false,true);if (this.editor && this.editor.obj)this.editor.obj.select()}, 
40 k33_0_0:function(){if(this.pagingOn)this.changePage(this.currentPage-1);else this.scrollPage(-1)},
41 k34_0_0:function(){if(this.pagingOn)this.changePage(this.currentPage+1);else this.scrollPage(1)}, 
42 k38_0_0:function(){if (this.editor && this.editor.combo)this.editor.shiftPrev();else{if (!this.row.idd)return;var rowInd = rowInd=this.getRowIndex(this.row.idd)+1;if (rowInd!=-1){var nrow=this._nextRow(rowInd-1,-1);this._Opera_stop=0;if (this.pagingOn && nrow)this.showRow(nrow.idd);this.selectCell(nrow,this.cell._cellIndex,false,false,true)}else this._key_events.k33_0_0.apply(this,[])};this._still_active=true}};
43//v.2.1 build 90226
44
45/*
46Copyright DHTMLX LTD. http://www.dhtmlx.com
47You allowed to use this component or parts of it under GPL terms
48To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com
49*/