diff --git a/js/app/views/MyDataUI.js b/js/app/views/MyDataUI.js index 152aac6..859396a 100644 --- a/js/app/views/MyDataUI.js +++ b/js/app/views/MyDataUI.js @@ -117,11 +117,11 @@ Ext.define('amdaUI.MyDataUI', { // edit in module from FileUpload Module and ExplorerModule (edit param) if (this.module.linkedNode) { if (this.module.linkedNode.get('fileObject')) { - this.fileObject = this.module.linkedNode.get('fileObject'); + this.fileObject = this.module.linkedNode.get('fileObject'); } // edit in module from Explorer Module (edit file) - else if (this.module.linkedNode.get('object')) { - this.fileObject = this.module.linkedNode.get('object'); + else if (this.module.linkedNode.get('object')) { + this.fileObject = this.module.linkedNode.get('object'); this.resetLinkedNode(); } else { @@ -167,13 +167,15 @@ Ext.define('amdaUI.MyDataUI', { } else { // cdf, cef, nc // select parameter - var radio = this.down('radiogroup'); - radio.setValue({'cdfvar' : this.object.get('realvar')}); + var radio = this.down('radiogroup'); + radio.suspendEvent('change'); + radio.setValue({'cdfvar' : this.object.get('realvar')}); + radio.resumeEvent('change'); // disable form fields defined in file this.disablePredefined(true); } } - + //Set table definition if (object.get('tableDef')) this.getPlugin('tabledef').setTableDefinition(object.get('tableDef')); @@ -186,8 +188,8 @@ Ext.define('amdaUI.MyDataUI', { { var form = this.down('form'); form.getForm().findField('start').setDisabled(disable); - form.getForm().findField('size').setDisabled(disable); - this.down('combobox').setDisabled(disable); + form.getForm().findField('size').setReadOnly(disable); + this.down('combobox').setReadOnly(disable); }, /* @@ -323,6 +325,10 @@ Ext.define('amdaUI.MyDataUI', { paramModule.linkedNode.set('iconCls', 'icon-scalar'); paramModule.linkedNode.set('isSpectra', false); } + else if (values.size == 3) { + paramModule.linkedNode.set('iconCls', 'icon-vector'); + paramModule.linkedNode.set('isSpectra', false); + } else { if (values.plottype == 'Spectra') { paramModule.linkedNode.set('isSpectra', true); @@ -492,18 +498,7 @@ Ext.define('amdaUI.MyDataUI', { var items = []; Ext.Array.each(vars, function(name, index) { if (name) { - items[index] = { boxLabel: name, name: 'cdfvar', inputValue: name, - listeners: - { - scope: this, - change: function (cb, nv, ov) { - if (nv) { - AmdaAction.getMyParamInfo({format: format, file : fileName, varName : cb.inputValue}, - this.updateInfo, this); - } - } - } - } + items[index] = { boxLabel: name, name: 'cdfvar', inputValue: name } } }, this); @@ -519,7 +514,16 @@ Ext.define('amdaUI.MyDataUI', { cls: 'x-check-group-alt', columns: 2, vertical: true, - items: items + items: items, + listeners : { + scope: this, + change: function (cb, nv, ov) { + if (nv.cdfvar) { + AmdaAction.getMyParamInfo({format: format, file : fileName, varName : nv.cdfvar}, + this.updateInfo, this); + } + } + } }] }; diff --git a/php/classes/FilesMgr.php b/php/classes/FilesMgr.php index de94c81..624b5a6 100644 --- a/php/classes/FilesMgr.php +++ b/php/classes/FilesMgr.php @@ -113,8 +113,11 @@ class FilesMgr extends AmdaObjectMgr else { $size = 1; } - - return array('type' => $data_type, 'size' => $size, 'n_records' => $n_recs); + + $units = exec('cdfvar_attr '.$this->fileName.' '.$cdfVarId.' UNITS'); + $fillval = exec('cdfvar_attr '.$this->fileName.' '.$cdfVarId.' FILLVAL'); + + return array('type' => $data_type, 'size' => $size, 'n_records' => $n_recs, 'units' => $units, 'fillvalue' => $fillval); } public function getCdfSampling() -- libgit2 0.21.2