[SOLUCIONADO]labelAlign: 'top' problema en un form
saludos tengo un problemilla con el alineamiento de los labels
he querido ponerlos encima de un textfield y no me resulta, no se en que puede estar el problema les dejo un codigo de prueba para comprobarlo, ojala alguien ya haya visto esto
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Formulario</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/styles.css" rel="stylesheet" type="text/css"/>
<!-- begin css add -->
<link rel="stylesheet" type="text/css" href="js/lib/ext/resources/css/ext-all.css" />
<!-- end css add -->
<!-- begin js add -->
<script type="text/javascript" src="js/lib/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="js/lib/ext/ext-all-debug.js"></script>
<script>
var formulario = new Ext.FormPanel({
renderTo:Ext.getBody(),
items: [{
region: 'center',
xtype: 'panel',
layout: 'anchor',
border: false,
layoutConfig: {
labelSeparator: '~' ,// superseded by assignment below
titleCollapse: false,
animate: false,
activeOnTop: false
},
items: [{
title: 'Busqueda de categoria',
height: 80,
frame : false,
collapsible: true,
border: false,
bodyStyle: 'padding:5px',
items: [{
layout:'column',
border: false,
items:[{
columnWidth: .18,
layout: 'form',
labelWidth: 70,
border: false,
items: [{
xtype: 'textfield',
fieldLabel:'Precio Lista',
labelAlign: 'top',
name: 'price' ,
id: 'price',
width: 50,
value: '${dto.price}'
} ]
},{
columnWidth: .19,
layout: 'form',
labelWidth: 90,
border: false,
items: [{
xtype: 'textfield',
fieldLabel: 'Stock cargado',
name: 'stock' ,
id: 'stock',
width: 50,
value: '${dto.stock}'
} ]
},{
columnWidth: .17,
layout: 'form',
labelWidth: 75,
border: false,
items: [{
xtype: 'textfield',
fieldLabel: 'Stock ficticio',
name: 'virtual_stock' ,
id: 'virtual_stock',
width: 50,
value: '${dto.virtual_stock}'
} ]
},{
columnWidth: .20,
layout: 'form',
labelWidth: 95,
border: false,
items: [{
xtype: 'textfield',
fieldLabel: 'Stock seguridad',
//labelAlign : 'top',
name: 'stock3' ,
id: 'stock3',
width: 60 ,
value: '${dto.security_stock}'
} ]
},{ columnWidth: .13,
layout: 'form',
labelWidth: 40,
border: false,
items: [{
xtype: 'checkbox',
fieldLabel: 'Valida stock',
name: 'stock_validation' ,
width: 60,
value: '${dto.stock_validation}'
} ]
},{ columnWidth: .1,
layout: 'form',
labelWidth: 40,
border: false,
items: [{
xtype: 'checkbox',
labelAlign: 'top',
fieldLabel: 'Costo Despacho',
name: 'despacho' ,
width: 60,
value: '${dto.shipping_code_cost}'
} ]
}, {columnWidth: .1,
layout: 'form',
border: false,
items:[{
xtype: 'button',
text: 'Actualizar',
arrowAlign: 'right',
icon:'../img/icons/folder_add.png',
cls:"x-btn-text-icon",
msgTarge: 'side',
handler: function(){
if (formulario.form.isValid()) {
formulario.form.submit({
waitMsg:'Procesando...',
url: 'AddCategoriaSubCategoriaJson',
failure: function(form, action) {
Ext.MessageBox.alert('Error', 'Problemas al ingresar Producto');
},
success: function(form, action) {
Ext.MessageBox.alert('Mensaje ', 'Ha sido ingresado correctamente');
store.load();
}
});
}
}
}]
}]
}]
}]
}]
})
</script>
</body>
</html>
solo cambien la direccion de las librerias extjs y estaria funcionando..
ojala alguien sepa de como dejarlos arriba los nombres de los atributos del formulario asi me quedaria todo en una sola linea
saludos a todos
<!-- s:) --><!-- s:) -->jaja lo postie y me di cuenta del error xD
siempre me pasa lo mismo...
solucion a futuros
estaba mal puesto el atributo labelAlign: 'top',
items:[{
columnWidth: .18,
layout: 'form',
labelWidth: 70,
labelAlign: 'top',
border: false,
items: [{
xtype: 'textfield',
fieldLabel:'Precio Lista',
name: 'price' ,
id: 'price',
width: 50,
value: '${dto.price}'
} ]
}
¿Conoces a alguien que pueda responder esta pregunta? Comparte el link en Twitter o Facebook
Es necesario registrarse para poder participar en el foro! Si ya tienes una cuenta puedes entrar y comentar en este foro.
