PDA

View Full Version : Panel scroll it self after validating with allowBlank.



saga56
31 Aug 2011, 8:31 AM
I have a panel with various form.Panel. When i scroll down to fill the fields, click inside one field and click a new one to text the allowblank, when i do this the message box and the validation of an empty fields accurs well, but the window auto-scroll up itself, and i want she to stay where she was!

http://alojaimagens.com/images/d9v3fi9s7u9rillnl3c.jpg

An example of a form.Panel here:


var dt = Ext.create('Ext.form.Panel', {
id: 'doccType',
bodyPadding: 10,
padding:'5px 0px 5px 0px',
defaults: {
anchor: '95%',
selectOnFocus: true,
msgTarget: 'side'
},
layout: 'anchor',
xtype: 'fieldset',
title:'Novo Documento',
items: [{
layout:'column',
border:false,
bodyStyle: 'padding:5px 0px 0px 5px',
defaults: {
allowBlank: false,
},
items:[{
xtype: 'textfield',
columnWidth:0.3,
id: 'doctType',
name: 'doctType',
fieldLabel: 'Tipo de Documento'
},{
xtype: 'displayfield',
fieldLabel: ' ',
name: '',
labelSeparator:'',
value: ' '
},{
xtype: 'textfield',
columnWidth:0.3,
id: 'docClass',
name: 'docClass',
fieldLabel: 'Classe do Documento'
}]
},{
defaults: {
allowBlank: false,
},
layout: 'column',
bodyStyle: 'padding:5px 0px 0px 5px',
border:false,
items:[{
xtype: 'numberfield',
columnWidth:0.3,
id: 'order',
name: 'order',
fieldLabel: 'Ordem',
minValue: 0,
allowDecimals: false
},{
xtype: 'displayfield',
fieldLabel: ' ',
name: '',
labelSeparator:'',
value: ' '
},{
xtype: 'combo',
columnWidth:0.3,
id: 'hasDocProp',
name: 'hasDocProp',
fieldLabel: 'O Documento tem Propriedades?',
editable:false,
store: new Ext.data.SimpleStore({
fields: ['id', 'desc'],
data: [['1', 'Sim'], ['0', 'Não']]
}),
displayField: 'desc',
valueField: 'id'
}]
}]
});





var painelDocumentos = Ext.create('Ext.panel.Panel', {


region: 'center',
border: true,
autoScroll:true,
margins: '5 5 5 5',
items: [dt,gridDocTypes,queues,gridQueues,queueFilters]
});