
Untitled
By: a guest on
May 17th, 2012 | syntax:
None | size: 5.21 KB | hits: 11 | expires: Never
saveGeofenceOptions =[{
/* En este panel se va a mostrar la lista de vehĂculos disponibles a los que se puede aplicar esta geocerca. */
id: 'geofenceVehiclesPanel',
title: 'Aplicar a:',
layout: 'fit',
flex: 1,
items: [{
/* Solo tiene un item, la lista donde se van a mostrar los vehiculos, se configura el store que es de tipo array
* el data lo obtenemos de la variable configuration.unitAias la cual es un array con los alias de las unidades
* mapeamos el unico campo que nos interesa que es el alias y lo mostramos. Finalmente creamos un toolbar con 2
* botones que nos permitiran seleccionar/deseleccionar todos los vehiculos. */
xtype: 'listview',
columns: [{
align: 'left',
dataIndex: 'alias',
}],
emptyText: 'No hay vehĂculos',
id: 'geofenceVehiclesList',
loadingText: 'Cargando lista...',
multiSelect: true,
simpleSelect: true,
selectedClass: 'x-list-selected-vehicle',
cls: 'geofence-window',
store: {
xtype: 'arraystore',
autoDestroy:true,
autoLoad: true,
data: arrayPerElement(configuration.unitAlias),
sortInfo: {
field: 'alias',
direction: 'ASC'
},
storeId: 'geofenceVehiclesStore',
fields: [{
name: 'alias',
mapping: 0
},
{
name: 'id',
mapping: 1
}]
},
hideHeaders: true
}],
bbar: {
id: 'geofenceToolbar',
items: [{
id: 'selectAllButton',
text: 'Todos',
handler: todosNingunoGeofence
},
"->",
{
id: 'selectNoneButton',
text: 'Ninguno',
handler: todosNingunoGeofence
}]
}
},
/* 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
* con un selector de color y finalmente una barra de botones la cual guarda o cancela la geocerca. */
{
layout: 'form',
bodyStyle: 'padding: 10px',
id: 'geofenceOptionsForm',
flex: 2,
items: [{
xtype: 'textfield',
id: 'geofenceName',
fieldLabel: 'Nombre',
text: 'Nombre de la geocerca',
anchor: '100%',
allowBlank: false,
maxLength: 50
},
{
xtype: 'container',
layout: 'hbox',
fieldLabel: 'Color de relleno',
items: [{
xtype: 'label',
id: 'geofenceFillColorLabel',
cls: 'geofenceFillColor',
width: 20,
height: 22
},
{
xtype: 'button',
cls: 'geofenceColorPicker',
iconCls:'icon-color_wheel',
menu: {
xtype: 'colormenu',
id: 'geofenceFillColorMenu',
handler: changeGeofenceColor,
paletteId: 'geofenceFillColorPalette'
},
}]
},
{
xtype: 'container',
layout: 'hbox',
fieldLabel: 'Color de contorno',
items: [{
xtype: 'label',
id: 'geofenceBorderColorLabel',
cls: 'geofenceBorderColor',
width: 20,
height: 22
},
{
xtype: 'button',
cls: 'geofenceColorPicker',
iconCls:'icon-color_wheel',
menu: {
xtype: 'colormenu',
id: 'geofenceBorderColorMenu',
handler: changeGeofenceColor,
paletteId: 'geofenceBorderColorPalette'
},
}]
},
{
xtype: 'checkbox',
boxLabel: 'Enviar correo',
id: 'emailGeofenceCheckbox',
name: 'sendEmailChbx',
},{
xtype: 'textfield',
id: 'emails',
fieldLabel: 'Direcciones:',
text: '<Direcciones de correo>',
anchor: '100%',
allowBlank: false,
maxLength: 400
},
{
xtype: 'htmleditor',
id: 'emailMessage',
fieldLabel: 'Mensaje',
enableLinks:false,
anchor: '100%'
}],
buttonAlign: 'center',
buttons: [{
text: 'Guardar',
handler: saveCancelGeofence
},
{
text: 'Cancelar',
handler: saveCancelGeofence
}]
}]