FFTCmpt.js
1.29 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
Ext.define('amdaPlotComp.plotFunction.FFTCmpt', {
extend: 'amdaPlotComp.plotFunction.BaseComponent',
title: "FFT Arguments",
id: 'fftComboBox',
initComponent: function () {
const me = this;
// Define combo box store
const comboStore = Ext.create('Ext.data.Store', {
fields: ['label', 'value'],
data: [
{ label: 'Frequency', value: 'Frequency' },
{ label: 'Period', value: 'Period' }
]
});
// Create combo box
const fftCombo = Ext.create('Ext.form.field.ComboBox', {
itemId: me.id, // Add itemId here
fieldLabel: 'Abscisse',
store: comboStore,
queryMode: 'local',
displayField: 'label',
valueField: 'value',
editable: false,
value: 'Frequency'
});
// Assign items to the component
me.items = [fftCombo];
// Call the parent class's initComponent method
me.callParent(arguments);
},
getValues: function () {
const fftComboBox = this.down('#'+this.id); // Retrieve ComboBox by itemId
const selectedValue = fftComboBox.getValue(); // Get selected value
return {
abscisse: selectedValue
};
}
});