Commit bc4ec5214a9912a747fe4d100fcabea0de7da27f

Authored by Hacene SI HADJ MOHAND
1 parent 5b3c2c8a

il reste quelques reglages

Showing 1 changed file with 36 additions and 18 deletions   Show diff stats
js/app/views/PlotComponents/PlotSauvaudForm.js
... ... @@ -10,28 +10,46 @@ Ext.define('amdaPlotComp.PlotSauvaudForm', {
10 10 requires: [
11 11 'amdaUI.ParamArgumentsUI'
12 12 ],
  13 + setObject: function (object) {
  14 + this.data = object.data;
  15 + this.object = object.get('param-drawing-object');
  16 +
  17 + this.loadRecord(this.object);
  18 + },
  19 +
  20 + /**
  21 + * Populate the comboBoxValue by the set of channel data related to the selected dimension
  22 + * @param {*} ref the reference of the current instance of this class
  23 + * @param {*} index dimension's index
  24 + * @param {*} comboBoxV the comboBoxValue
  25 + * @returns
  26 + */
  27 +
  28 +
  29 + addComboSauvaudDim: (ref) => {
  30 +
  31 + const comboBoxDim = ref.addStandardCombo(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey,
  32 + amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimlabel, [],
  33 + (name, newKey, oldKey) => {
  34 +
  35 + ref.populateSauvaudComboBoxValue(ref, newKey, this);
  36 + });
  37 +
  38 + return comboBoxDim;
  39 + },
  40 +
  41 + getSauvaudItems(){
  42 + return [this.addComboSauvaudDim(this)];
  43 + },
13 44  
14 45 getFormItems: function () {
15 46 items = this.callParent();
16 47 const ref = this;
17   - /**
18   - const newDataForStore = [];
19   - for (indexTable in ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName]) {
20   - const table = ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName][indexTable];
21   - let item = {};
22   - item[keyTemp] = indexTable;
23   - item[valueTemp] = table[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableRelatedDim];
24   - newDataForStore.push(item);
25   - }
26   - console.log(newDataForStore);
27   - this.getFilteringItems();
28   -*/
29   - var availableDims = [];
30   - availableDims = [
31   - { 'key': 0, 'value': 'Dim1' },
32   - { 'key': 1, 'value': 'Dim2' }
33   - ];
34   - const dimField = this.addStandardCombo('right_dimension', 'Right Dim', availableDims, function (name, value, oldValue) {
  48 + const dataStore = [
  49 + { 'key': 0, 'value': 'dim1' },
  50 + { 'key': 1, 'value': 'dim2' },
  51 + ];
  52 + const dimField = this.addStandardCombo('right_dimension', 'Right Dim', dataStore , function (name, value, oldValue) {
35 53 if (ref.object.get('right_dim') != value) {
36 54 ref.object.set('right_dim', value);
37 55 }
... ...