BodySelection.js
2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Ext.define('treps.controller.Bodies.BodySelection', {
extend: 'Ext.app.Controller',
requires: [
'treps.controller.Bodies.BodiesManager'
],
views: [
'Steps.TransformationDefinition.BodySelectionPanel',
'treps.view.Bodies.BodiesCombo'
],
refs: [
{
ref: 'bodiesCenterCombo',
selector: '#centercombo'
},
{
ref: 'bodiesScCombo',
selector: '#sccombo'
}
],
init: function() {
var me = this;
//console.log('BodySelection init '+this.getView('Steps.TransformationDefinition.BodySelectionPanel'));
},
initStore: function(start,stop,onReady)
{
var me = this;
this.getView('Steps.TransformationDefinition.BodySelectionPanel').create();
console.log("bodies centr combo: "+me.getBodiesCenterCombo());
console.log("bodies sc combo: "+me.getBodiesScCombo());
//if(isSc) {
treps.controller.Bodies.BodiesManager.loadBodiesStore(treps.model.Session.get('id'),'true',start, stop,
function(store) {
//console.log(me);
me.getBodiesScCombo().store = store;
if (onReady != null) {
treps.controller.Bodies.BodiesManager.loadBodiesStore(treps.model.Session.get('id'),'false',start, stop,
function(store) {
//console.log(me);
me.getBodiesCenterCombo().store = store;
if (onReady != null) {
onReady.call(me, store);
}
}
);
}
}
);
//} else {
//}
},
getBodySelWin: function(pTitle) {
var me = this;
console.log(this.getView('Steps.TransformationDefinition.BodySelectionPanel'));
return Ext.create('Ext.window.Window', {
title: pTitle,
layout: 'fit',
modal: true,
maximizable: false,
collapsible:false,
floating:true,
closable:false,
centered:true,
//items:[{xtype:'bodies_panel'}]
});
},
//get 'id name' string of selected sc
getScBody: function() {
return this.getBodiesScCombo().getValue()+' '+this.getBodiesScCombo().getRawValue();
},
setScBody: function(body) {
this.getBodiesScCombo().setValue(body);
},
//get 'id name' string of selected natural body
getCenterBody: function() {
return this.getBodiesCenterCombo().getValue()+' '+this.getBodiesCenterCombo().getRawValue();
},
setCenterBody: function(body) {
this.getBodiesCenterCombo().setValue(body);
}
});