Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 17th, 2012  |  syntax: None  |  size: 5.21 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. saveGeofenceOptions =[{
  2.                                                         /* En este panel se va a mostrar la lista de vehĂ­culos disponibles a los que se puede aplicar esta geocerca. */
  3.                                                         id:     'geofenceVehiclesPanel',
  4.                                                         title:  'Aplicar a:',
  5.                                                         layout: 'fit',
  6.                                                         flex:   1,
  7.                                                         items:  [{
  8.                                                                                 /* Solo tiene un item, la lista donde se van a mostrar los vehiculos, se configura el store que es de tipo array
  9.                                                                                  * el data lo obtenemos de la variable configuration.unitAias la cual es un array con los alias de las unidades
  10.                                                                                  * mapeamos el unico campo que nos interesa que es el alias y lo mostramos. Finalmente creamos un toolbar con 2
  11.                                                                                  * botones que nos permitiran seleccionar/deseleccionar todos los vehiculos. */
  12.                                                                                 xtype:                  'listview',
  13.                                                                                 columns:                [{
  14.                                                                                                                         align:          'left',
  15.                                                                                                                         dataIndex:      'alias',
  16.                                                                                                                 }],
  17.                                                                                 emptyText:              'No hay vehĂ­culos',
  18.                                                                                 id:                     'geofenceVehiclesList',
  19.                                                                                 loadingText:    'Cargando lista...',
  20.                                                                                 multiSelect:    true,
  21.                                                                                 simpleSelect:   true,
  22.                                                                                 selectedClass:  'x-list-selected-vehicle',
  23.                                                                                 cls:                    'geofence-window',
  24.                                                                                 store:                  {
  25.                                                                                                                         xtype:          'arraystore',
  26.                                                                                                                         autoDestroy:true,
  27.                                                                                                                         autoLoad:       true,
  28.                                                                                                                         data:           arrayPerElement(configuration.unitAlias),
  29.                                                                                                                         sortInfo:       {
  30.                                                                                                                                                         field: 'alias',
  31.                                                                                                                                                         direction: 'ASC'
  32.                                                                                                                                                 },
  33.                                                                                                                         storeId:        'geofenceVehiclesStore',
  34.                                                                                                                         fields:         [{
  35.                                                                                                                                                         name: 'alias',
  36.                                                                                                                                                         mapping: 0
  37.                                                                                                                                                 },
  38.                                                                                                                                                 {
  39.                                                                                                                                                         name: 'id',
  40.                                                                                                                                                         mapping: 1                                                                                                                                                     
  41.                                                                                                                                                 }]
  42.                                                                                                                 },
  43.                                                                                 hideHeaders: true
  44.                                                                         }],
  45.                                                         bbar:   {
  46.                                                                                 id:     'geofenceToolbar',
  47.                                                                                 items:  [{
  48.                                                                                                         id:             'selectAllButton',
  49.                                                                                                         text:           'Todos',
  50.                                                                                                         handler:        todosNingunoGeofence
  51.                                                                                                 },
  52.                                                                                                 "->",
  53.                                                                                                 {
  54.                                                                                                         id:             'selectNoneButton',
  55.                                                                                                         text:           'Ninguno',
  56.                                                                                                         handler:        todosNingunoGeofence
  57.                                                                                                 }]
  58.                                                                         }
  59.                                                 },
  60.                                                 /* Este panel tiene las opciones que podemos configurar para la geocerca, se genera con 1 field de texto, 2 paneles que contienen 2 labels y un boton
  61.                                                  * con un selector de color y finalmente una barra de botones la cual guarda o cancela la geocerca. */
  62.                                                 {
  63.                                                         layout:         'form',
  64.                                                         bodyStyle:      'padding: 10px',
  65.                                                         id:             'geofenceOptionsForm',
  66.                                                         flex:           2,
  67.                                                         items:          [{
  68.                                                                                         xtype:          'textfield',
  69.                                                                                         id:                     'geofenceName',
  70.                                                                                         fieldLabel: 'Nombre',
  71.                                                                                         text:           'Nombre de la geocerca',
  72.                                                                                         anchor:         '100%',
  73.                                                                                         allowBlank:     false,
  74.                                                                                         maxLength:      50
  75.                                                                                        
  76.                                                                                 },
  77.                                                                                 {
  78.                                                                                         xtype:          'container',
  79.                                                                                         layout:         'hbox',
  80.                                                                                         fieldLabel: 'Color de relleno',
  81.                                                                                         items:          [{
  82.                                                                                                                         xtype:  'label',
  83.                                                                                                                         id:     'geofenceFillColorLabel',
  84.                                                                                                                         cls:    'geofenceFillColor',
  85.                                                                                                                         width:  20,
  86.                                                                                                                         height: 22
  87.                                                                                                                 },
  88.                                                                                                                 {
  89.                                                                                                                         xtype:  'button',
  90.                                                                                                                         cls:    'geofenceColorPicker',
  91.                                                                                                                         iconCls:'icon-color_wheel',
  92.                                                                                                                         menu:   {
  93.                                                                                                                                                 xtype:          'colormenu',
  94.                                                                                                                                                 id:             'geofenceFillColorMenu',
  95.                                                                                                                                                 handler:        changeGeofenceColor,
  96.                                                                                                                                                 paletteId:      'geofenceFillColorPalette'
  97.                                                                                                                                         },
  98.                                                                                                                 }]
  99.                                                                                 },
  100.                                                                                 {
  101.                                                                                         xtype:          'container',
  102.                                                                                         layout:         'hbox',
  103.                                                                                         fieldLabel: 'Color de contorno',
  104.                                                                                         items:          [{
  105.                                                                                                                         xtype:  'label',
  106.                                                                                                                         id:     'geofenceBorderColorLabel',
  107.                                                                                                                         cls:    'geofenceBorderColor',
  108.                                                                                                                         width:  20,
  109.                                                                                                                         height: 22
  110.                                                                                                                 },
  111.                                                                                                                 {
  112.                                                                                                                         xtype:  'button',
  113.                                                                                                                         cls:    'geofenceColorPicker',
  114.                                                                                                                         iconCls:'icon-color_wheel',
  115.                                                                                                                         menu:   {
  116.                                                                                                                                                 xtype:          'colormenu',
  117.                                                                                                                                                 id:             'geofenceBorderColorMenu',
  118.                                                                                                                                                 handler:        changeGeofenceColor,
  119.                                                                                                                                                 paletteId:      'geofenceBorderColorPalette'
  120.                                                                                                                                         },
  121.                                                                                                                 }]
  122.                                                                                 },
  123.                                                                                 {
  124.                                                                                         xtype:          'checkbox',
  125.                                                                                         boxLabel:       'Enviar correo',
  126.                                                                                         id:                     'emailGeofenceCheckbox',
  127.                                                                                         name:           'sendEmailChbx',
  128.                                                                                 },{
  129.                                                                                         xtype:          'textfield',
  130.                                                                                         id:                     'emails',
  131.                                                                                         fieldLabel: 'Direcciones:',
  132.                                                                                         text:           '<Direcciones de correo>',
  133.                                                                                         anchor:         '100%',
  134.                                                                                         allowBlank:     false,
  135.                                                                                         maxLength:      400
  136.                                                                                 },
  137.                                                                                 {
  138.                                                                                         xtype:          'htmleditor',
  139.                                                                                         id:                     'emailMessage',
  140.                                                                                         fieldLabel:     'Mensaje',
  141.                                                                                         enableLinks:false,
  142.                                                                                         anchor:         '100%'
  143.                                                                                 }],
  144.                                                                                 buttonAlign:    'center',
  145.                                                                                 buttons:                [{
  146.                                                                                                                         text:           'Guardar',
  147.                                                                                                                         handler:        saveCancelGeofence
  148.                                                                                                                 },
  149.                                                                                                                 {
  150.                                                                                                                         text:           'Cancelar',
  151.                                                                                                                         handler:        saveCancelGeofence
  152.                                                                                                                 }]
  153.                                                 }]