View Full Version : changing the allowblank property of a combobox

21 Nov 2010, 11:32 AM
I have a mandatory combobox and I change the allowblank property by a rigth click :

field.allowBlank = true;

But the change isn't taken in account immediately. To have it taken in account, I have to manually respectively focus the combobox then focus another field.

Is there a way to have it taken in account immediately programmatically

Thank you in advance for your answers

21 Nov 2010, 5:53 PM
Are you saying that the user can toggle whether or not a field is required? I assume you mean that you want the field to immediately re-validate after making this change? If so, you'll probably also want to call field.validate() after setting the allowBlank property.

Anup Rana
26 Nov 2010, 4:26 AM
How to use allowblank property false on combobox.It is not working on combobox.

xtype : 'combo',
fieldLabel : '<font color=#15428B><b>Company Name</b></font>',
id : 'uploadCmpName',
name : 'uploadCmpName',
displayField : 'cname',
valueField : 'cmpid',
store : uploadCompanyStore,
triggerAction : 'all',
mode : 'local',
autoSelect : false,
forceSelection : true,
disableKeyFilter : false,
typeAhead : false,
lazyInit : false,

emptyText : 'Please Select',
selectOnFocus : true,
width : 180

26 Nov 2010, 5:24 AM
Hibrian.moeskau and thank you for your answer

actually field.validate() was the solution