Commit edd2e65045d0757f0054f22a8931d542efc77a3b

Authored by Hacene SI HADJ MOHAND
1 parent 833e6c62

correcting 7100

Showing 1 changed file with 43 additions and 43 deletions   Show diff stats
js/app/views/CatalogUI.js
... ... @@ -366,7 +366,7 @@ Ext.define('amdaUI.CatalogUI', {
366 366 filter: { type: 'numeric'}
367 367 }
368 368 ];
369   -
  369 + var pramColumnWidth =120*(1-0.7*(1-1/result.parameters.length));
370 370 Ext.Array.each(result.parameters, function(obj, index) {
371 371 var field = {
372 372 name: obj.id
... ... @@ -384,43 +384,43 @@ Ext.define('amdaUI.CatalogUI', {
384 384 });
385 385 column = Ext.apply({}, column, {
386 386 xtype: 'gridcolumn',
387   - width : 50. * parseInt(obj.size),
  387 + width : pramColumnWidth * parseInt(obj.size),
388 388 editor: 'textfield',
389 389 filter: { type: 'numeric'}
390 390 });
391 391 break;
392   - case 1: //dateTime
393   - field = Ext.apply({}, field, {
394   - type : 'date',
395   - dateFormat: 'Y-m-d\\TH:i:s',
396   - convert: function(value,rec) {
397   - if (!Ext.isDate(value)){
398   - var valueString = new String(value);
399   - return new Date(valueString.replace(/\-/g,'\/').replace(/[T|Z]/g,' '));
400   - }
401   - return value;
402   - }
403   -
404   - });
405   - column = Ext.apply({}, column, {
406   - xtype: 'datecolumn',
407   - width : 120,
408   - editor : {
409   - xtype:'datefield',
410   - allowBlank:false,
411   - hideTrigger: true,
412   - format : 'Y-m-d\\TH:i:s'
413   - },
414   - filter: { type: 'date', dateFormat: 'Y-m-d' }
415   - });
416   - break;
  392 + case 1: //dateTime
  393 + field = Ext.apply({}, field, {
  394 + type : 'date',
  395 + dateFormat: 'Y-m-d\\TH:i:s',
  396 + convert: function(value,rec) {
  397 + if (!Ext.isDate(value)){
  398 + var valueString = new String(value);
  399 + return new Date(valueString.replace(/\-/g,'\/').replace(/[T|Z]/g,' '));
  400 + }
  401 + return value;
  402 + }
  403 +
  404 + });
  405 + column = Ext.apply({}, column, {
  406 + xtype: 'datecolumn',
  407 + width : 120,
  408 + editor : {
  409 + xtype:'datefield',
  410 + allowBlank:false,
  411 + hideTrigger: true,
  412 + format : 'Y-m-d\\TH:i:s'
  413 + },
  414 + filter: { type: 'date', dateFormat: 'Y-m-d' }
  415 + });
  416 + break;
417 417 case 2: //string
418 418 field = Ext.apply({}, field, {
419 419 type: 'string'
420 420 });
421 421 column = Ext.apply({}, column, {
422 422 xtype: 'gridcolumn',
423   - width : 50. * parseInt(obj.size),
  423 + width : pramColumnWidth * parseInt(obj.size),
424 424 editor: 'textfield',
425 425 filter: { type: 'string'}
426 426 });
... ... @@ -431,25 +431,25 @@ Ext.define('amdaUI.CatalogUI', {
431 431 });
432 432 column = Ext.apply({}, column, {
433 433 xtype: 'gridcolumn',
434   - width : 50. * parseInt(obj.size),
  434 + width : pramColumnWidth * parseInt(obj.size),
435 435 editor: 'textfield',
436 436 filter: { type: 'numeric'}
437 437 });
438 438 break;
439   - default:
440   - field = Ext.apply({}, field, {
441   - type: 'string'
442   - });
443   - column = Ext.apply({}, column, {
444   - xtype: 'gridcolumn',
445   - width : 50. * parseInt(obj.size),
446   - editor: 'textfield',
447   - filter: { type: 'string'}
448   - });
449   - }
450   - fieldsConfig.push(field);
451   - columnsConfig.push(column);
452   - });
  439 + default:
  440 + field = Ext.apply({}, field, {
  441 + type: 'string'
  442 + });
  443 + column = Ext.apply({}, column, {
  444 + xtype: 'gridcolumn',
  445 + width : pramColumnWidth * parseInt(obj.size),
  446 + editor: 'textfield',
  447 +filter: { type: 'string'}
  448 + });
  449 +}
  450 +fieldsConfig.push(field);
  451 +columnsConfig.push(column);
  452 +});
453 453  
454 454 var store = Ext.create('Ext.data.Store', {
455 455 fields: fieldsConfig,
... ...