PDA

View Full Version : 4.1.1 - issue on Combo box set Value & form reset functions



rajesh.vji
11 Oct 2012, 2:27 AM
we have upgraded to extjs 4.1.1 gl recently. after upgrading we are getting the following errors

1. form reset functionality is not resetting the combo box (drop down) values but it works fine in Text fields. earlier version it was working fine including combo box (drop down).

i have enclosed the extjs code which we are using. kindly help us to solve this issue at the earliest.


var TxrlabDeviceField = new Ext.form.ComboBox(
{
// Initializing the field variables

name : 'lab',
id : 'lab',
fieldLabel : 'Lab',
store : LabStore,
emptyText : '-Select Lab -',
bodyStyle : 'padding:15px',
loadmask : true,
mode : 'remote',
displayField : 'spname',
valueField : 'lab_id',
allowBlank : false,
typeAhead : true,
editable : true,
queryMode : 'local',
forceSelection : false,
anchor :'30%',
triggerAction : 'all',
listeners:
{
// Adding a onSelect listener to LAB field
select: function(combo, recordTest, index)
{
//Get lab value from the combo box
var val = Ext.getCmp('lab').getValue();
var record = Ext.getCmp('lab').findRecord(Ext.getCmp('lab').displayField, val);

//Get the lab_id from the value of the lab combo box
var labId = record.get('lab_id');

refreshAisleCombo(labId,'aisle');

Ext.getCmp("AisleLoc").getStore().removeAll();
Ext.getCmp("AisleLoc").setValue(''); // Not working in extjs 4.1.1


}
}


the form portion

var gridForm = Ext.create('Ext.FormPanel', {

frame: true,
title: 'Change To',
width: 900,
layout:'hbox',
fieldDefaults:
{
labelAlign: 'top',
msgTarget: 'side'
},
defaults:
{
border: false,
xtype: 'panel',
flex: 1,
layout: 'anchor'
},


defaultType: 'textfield',
items: [TxrlabDeviceField, TxrAisleFieldDevice, TxrAisleLocFieldDevice,TxrDeviceOwner,TxrLDAPStatus],
buttons: [{
text: 'Reset',
handler: function()
{
this.up('form').getForm().reset();// Not working in extjs 4.1.1
}
},
{
text: 'Transfer Asset(s)',
handler: assetTransfer

}]
});

scottmartin
12 Oct 2012, 6:04 AM
The following should work as expected:
http://jsfiddle.net/jeMzE/

Scott.