ZoomIntervalSelection.js
1.4 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
Ext.define('amdaPlotComp.intervalSelection.ZoomIntervalSelection', {
extend: 'amdaPlotComp.intervalSelection.IntervalSelection', // This class extends from amdaPlotComp.intervalSelection.IntervalSelection
buttonApply: "Apply Zoom",
type: null,
initComponent: function () {
const me = this;
this.callParent(arguments);
this.parent.getDockedItems('toolbar[dock="bottom"]')[0].add({
xtype: 'button',
width: width,
text: 'Undo Zoom',
handler: function () {
me._undoZoom();
}
});
},
_apply: function () {
if (this._notValidValues()) {
myDesktopApp.warningMsg('The Input Values are not defined');
} else {
this.hostCmp.callInteractivePlot({
'action': 'zoom',
'interactiveId': this.interactiveId,
'panelId': this.panelId,
'axeId': this.type,
'min': this.getField1Value(),
'max': this.getField2Value()
});
this._resetHostCmpSelection();
}
},
_undoZoom: function () {
this.hostCmp.callInteractivePlot({
'action': 'undozoom',
'interactiveId': this.interactiveId,
'panelId': this.panelId,
'axeId': this.type
});
this._resetHostCmpSelection();
}
});