From 5f341ae73adfc199f26c6be3ac390a199049e5d7 Mon Sep 17 00:00:00 2001 From: Hacene SI HADJ MOHAND Date: Wed, 23 Sep 2020 14:30:32 +0200 Subject: [PATCH] ok pour download --- js/app/models/InteractiveNode.js | 13 +++++++++++++ js/app/views/DownloadUI.js | 22 +++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/js/app/models/InteractiveNode.js b/js/app/models/InteractiveNode.js index 06f20bb..59db549 100644 --- a/js/app/models/InteractiveNode.js +++ b/js/app/models/InteractiveNode.js @@ -478,6 +478,7 @@ Ext.define('amdaModel.InteractiveNode', { paramName = "#"+node.get('text'); break; case 'amdaModel.DerivedParamComponentNode' : + paramId = node.get('text'); var parentId = paramId.substr(0, paramId.length - 3); paramName= "ws_" + parentId; @@ -489,6 +490,18 @@ Ext.define('amdaModel.InteractiveNode', { components['index1'] = component_index[1]; } break; + case 'amdaModel.MyDataParamComponentNode' : + paramId = node.get('text'); + var parentId = paramId.substr(0, paramId.length - 3); + paramName= "wsd_" + parentId; + var regExp = /\(([\d]+)\)/; + var component_index = regExp.exec(paramId); + if (component_index) + { + components = []; + components['index1'] = component_index[1]; + } + break; case 'amdaModel.DerivedParamNode' : paramName = "ws_"+node.get('text'); break; diff --git a/js/app/views/DownloadUI.js b/js/app/views/DownloadUI.js index 0685ee4..115f6be 100644 --- a/js/app/views/DownloadUI.js +++ b/js/app/views/DownloadUI.js @@ -128,8 +128,9 @@ Ext.define('amdaUI.DownloadUI', { Ext.Array.each(arrayParams, function (item) { if (Ext.isObject(item)) { // handel case of derived parameters - var patt = new RegExp("ws_"); - if (typeof paramId !== 'undefined' && ! patt.test(item.paramid)) + var patt_ws = new RegExp("ws_"); + var patt_wsd = new RegExp("wsd_"); + if (typeof paramId !== 'undefined' && ! patt_ws.test(item.paramid) && ! patt_wsd.test(item.paramid)) { // for Parameter Name in Download Module var paramObj = amdaModel.RequestParamObject.getEmptyObj(); @@ -459,7 +460,6 @@ Ext.define('amdaUI.DownloadUI', { } break; case 'alias' : - // console.log(data.records[0].data); idToSent = "#" + data.records[0].get('text'); break; case 'derivedParam' : @@ -482,7 +482,23 @@ Ext.define('amdaUI.DownloadUI', { } break; case 'myDataParam' : + if (data.records[0].modelName == 'amdaModel.MyDataParamComponentNode') + { + paramId = data.records[0].get('text'); + var parentId = paramId.substr(0, paramId.length - 3); + idToSent = "wsd_" + parentId; + var regExp = /\(([\d]+)\)/; + var component_index = regExp.exec(paramId); + if (component_index) + { + components = []; + components['index1'] = component_index[1]; + } + break; + } + else{ idToSent = "wsd_" + data.records[0].get('text'); + } break; default : return false; -- libgit2 0.21.2