PDA

View Full Version : monitorValid / stopMonitoring not working



RobertT
14 Sep 2010, 2:04 AM
sorry, wrong category, should be in extJS


Hi everybody

I think i found a bug with the monitorValid and stopMonitoring method, they don't work for me. The red border of the email field still appears as i start to type in some letters in it

Any ideas? Is this a bug?


var login = new Ext.FormPanel(

{
labelWidth : 80,
id: 'frmLogin',
url : base_url + 'index.php/authenticate/login',
frame : true,
border : false,
title : Language.login_form_title,
defaultType : 'textfield',
renderTo : 'extjs-login-form',
width : 345,
height : 125,
iconCls: 'silk-key',
monitorValid: false,
items : [ {
fieldLabel : Language.email,
name : 'loginUsername',
allowBlank : false,
width: 240,
vtype : 'email'
}, {
fieldLabel : Language.password,
name : 'loginPassword',
inputType : 'password',
width: 240,
allowBlank : false
} ],



// All the magic happens after the user clicks the button

buttons : [ {
text : 'Login',
// Function that fires when user clicks the button
handler : fSubmitLogin
} ],
keys: [{ key: [Ext.EventObject.ENTER], handler: fSubmitLogin }]
});

Ext.getCmp('frmLogin').getForm().stopMonitoring();

Condor
14 Sep 2010, 2:37 AM
Monitoring only polls all fields at regular intervals to be able to update button enabled states etc.

It has nothing to do with validation of the fields themselves.