From 9827d46840c7e0546621c76c2353546f1fc11bae Mon Sep 17 00:00:00 2001
From: Hacene SI HADJ MOHAND <hacene.si-hadj-mohand@akka.eu>
Date: Wed, 9 Jun 2021 12:14:43 +0200
Subject: [PATCH] us ok

---
 js/app/views/DownloadUI.js | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/js/app/views/DownloadUI.js b/js/app/views/DownloadUI.js
index 67bc5b3..74c7bd0 100644
--- a/js/app/views/DownloadUI.js
+++ b/js/app/views/DownloadUI.js
@@ -289,7 +289,7 @@ Ext.define('amdaUI.DownloadUI', {
         //TT download
         else
         {
-            var timeformat = values.timeformatTT;
+            var timeformat = values.timeformatTT ? alues.timeformatTT :amdaModel.DownloadConfig.defaultValues.timeformatTT;
             var compression = values.compressionTT;
             var fileformat = values.fileformatTT;
             if (this.TTGrid.getStore().count() == 0) {
@@ -371,6 +371,21 @@ Ext.define('amdaUI.DownloadUI', {
             samplingField.setDisabled((newValue == 2) || refParamCheck.getValue());
         }
     },
+    onTTFileFormatChange: function (combo, newValue, oldValue) {
+         if (!this.formPanel)
+            return;
+
+        var refTimeFormatField = this.formPanel.getForm().findField('timeformatTT');
+
+        if (refTimeFormatField && newValue !== oldValue) {
+                       if (newValue === 'space' ){
+                           refTimeFormatField.setValue('YYYY-MM-DDThh:mm:ss');
+                           refTimeFormatField.setDisabled(true);
+                       }else{
+                           refTimeFormatField.setDisabled(false);
+                       }
+        }
+    },
 
     onRefParamSamplingChange: function (check, newValue, oldValue) {
         if (!this.formPanel)
@@ -651,7 +666,6 @@ Ext.define('amdaUI.DownloadUI', {
             fields: ['id', 'name', 'qtip'],
             data: amdaModel.DownloadConfig.timeformatData
         });
-
         this.paramPanel = new Ext.container.Container({
             title: 'Parameters',
             layout: {
@@ -802,7 +816,11 @@ Ext.define('amdaUI.DownloadUI', {
                                 {
                                     fieldLabel: 'File Format ',
                                     name: 'fileformatTT',
-                                    store: amdaModel.DownloadConfig.fileformatTTData
+                                    store: amdaModel.DownloadConfig.fileformatTTData,
+                                    listeners: {
+                                        change: {fn: this.onTTFileFormatChange},
+                                            scope: this
+                                   }
                                 },
                                 {
                                     fieldLabel: 'Compression ',
--
libgit2 0.21.2