diff options
| author | Andreas Brachold <vdr07@deltab.de> | 2010-09-11 16:42:32 +0000 |
|---|---|---|
| committer | Andreas Brachold <vdr07@deltab.de> | 2010-09-11 16:42:32 +0000 |
| commit | 2d07e3db2bb6cbb3d4d48c8702795a613599ecdd (patch) | |
| tree | e44027d22c7331ac995df7b2e795562692b8f1e5 /skins/jason/program.js | |
| parent | 2384e06fdf70bfe51fc242fb06edb54be3a3e4e3 (diff) | |
| download | xxv-2d07e3db2bb6cbb3d4d48c8702795a613599ecdd.tar.gz xxv-2d07e3db2bb6cbb3d4d48c8702795a613599ecdd.tar.bz2 | |
jason: keep selection if timer programmed
Diffstat (limited to 'skins/jason/program.js')
| -rw-r--r-- | skins/jason/program.js | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/skins/jason/program.js b/skins/jason/program.js index 8195306..7b9e096 100644 --- a/skins/jason/program.js +++ b/skins/jason/program.js @@ -27,6 +27,7 @@ Ext.xxv.programStore = function(data) { ,{name: 'timerid', type: 'string'} ,{name: 'timeractiv', type: 'string'} ,{name: 'running', type: 'string'} + ,{name: 'level', type: 'int'} ] }), proxy : new Ext.data.HttpProxy({ @@ -92,7 +93,7 @@ Ext.xxv.programGrid = function(viewer, record) { ,sm: new Ext.grid.RowSelectionModel({ singleSelect:false }) - ,view: new Ext.grid.GroupingView({ + ,view: new Ext.xxv.GroupingView({ enableGroupingMenu:false, forceFit:true, showGroupName: false, @@ -137,7 +138,11 @@ Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, { this.preview.clear(); } ,onLoad : function( store, records, opt ) { - this.getSelectionModel().selectFirstRow(); + if(this.view.keepSelection) + this.getSelectionModel().selectRows(this.view.keepSelection,false); + else + this.getSelectionModel().selectFirstRow(); + this.ownerCt.SetPanelTitle(store.title); } ,onContextClick : function(grid, index, e){ @@ -235,10 +240,25 @@ Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, { ids += ','; ids += sel[i].data.id; } - this.viewer.RecordID(ids); + this.viewer.RecordID(ids, this.updateTimer, this); + } + ,updateTimer : function() { + var gsm = this.getSelectionModel(); + if(gsm.hasSelection()) { + this.view.keepSelection = new Array(); + for(var i = 0, len = this.store.getCount(); i < len; i++){ + if(gsm.isSelected(i)) { + this.view.keepSelection.push(i); + } + } + } + this.store.reload(); + if(this.viewer.gridTimer) { + this.viewer.gridTimer.dataDirty = true; + } } ,EditTimer : function(record) { - this.viewer.gridNow.EditTimer(record, this.store); + this.viewer.gridNow.EditTimer(record, this.updateTimer, this); } ,DeleteTimer : function(record) { var gsm = this.getSelectionModel(); |
