PDA

View Full Version : vtype not triggering.



n00bster
22 Jun 2009, 1:26 PM
I cannot seem to get a vtype to triggure, AND / OR get allowblank to work

can you spot something ?


here is the fieldset declaration

var fieldset6 = { // Pieces,Weight
xtype : 'fieldset',
width : '478',
layout : 'form',
autoHeight: true,
allowBlank : false,

border : false,
anchor : '-10',
layout: 'column',
items : [


{
xtype : 'container',
autoEl : {},
border : false,
layout : 'column',
anchor : '100%',

defaultType : 'field',
items : [


{
xtype : 'container',
autoEl : {},
layout : 'form',
width : 260,
items : [
{
xtype : 'field',

value : '1',
fieldLabel : 'Pieces',
vtype : 'numeric' ,
allowBlank : false,
width : 130,
minChars : 0,

listeners : {
"Change":function() {refreshServices();
}
}
,

name : 'formPieces',
id : 'formPieces'

}
]

},
{
xtype : 'container',
autoEl : {},
layout : 'form',
columnWidth : 1,
labelWidth : 80,
items : [
{
xtype : 'field',
fieldLabel : 'Weight',
width : 110,
labelWidth : 150,
vtype : 'numeric' ,
monitorValid:true,
layout : 'form',
value : '1',
listeners : {
"Change":function() {refreshServices();


}

},
name : 'formWeight',
id : 'formWeight'

}
]
}






]

}
]


//
}




///////////////////////////////////////////
the field set is in this container

var fieldsetContainer3 = {
xtype : 'container',
height : 50,
layout : 'hbox',
//anchor : '100%',
layoutConfig : {
},
items : [
fieldset5,fieldset6
]
}


which is in this panel

var fp = new Ext.form.FormPanel({
renderTo : Ext.getBody(),
width : 1000,
height : 450,
monitorValid : true,
frame : true,
layout : 'vbox',
layoutConfig : {
align : 'stretch'
},
items : [
fieldsetContainer4

]
});

aconran
23 Jun 2009, 9:12 AM
The behavior has been changed in Ext 3.0 as of revision 4467 (Post RC2) to run the validators in validateValue in the following order:
validator, allowBlank, minLength, maxLength, vtype then regex

http://extjs.com/forum/showthread.php?t=69859&p=345729

Expect your above code to work in Ext 3.0 RC 2.1 or what is currently in SVN.

n00bster
30 Jun 2009, 6:43 PM
It was because I had xtype : 'field'

instead of xype : 'textfield'