shaoen01
3 Dec 2011, 7:11 PM
Hi all,
I am currently using a combo box or dropdown menu on my grid with roweditor plugin. I would like to know the old value before it was selected. I am using the change listener to do that. However, there are a few ways to select the value. Either you use a mouse click to select (in this case change will be fired) or you can type in and there's an autocomplete.
So in the auto-complete mode, say the actual value is "abc123" and i am typing "ab" it will show a potential match. So i normally just do a tab and the full value gets populated. So in this case, i am unable to get the old value. Could it be that change event is not fired? Any advise on how to handle non mouse-click selection?
field: {
xtype: 'combobox',
id: "namecombo",
typeAhead: true,
triggerAction: 'all',
selectOnTab: true,
store: userstorecombo,
displayField: 'fullname',
//valueField: 'productid',
lazyRender: true,
allowBlank:false,
listClass: 'x-combo-list-small',
msgTarget: 'side',
queryMode: 'local',
listeners: {
scope: this,
select: function(field, value, options)
{
selected_combo_display=field.getRawValue();
},
change: function (field, newValue, oldValue, options) {
selected_combo_display=newValue;
selected_combo_display_old=oldValue
}
}//end listener
}
I am currently using a combo box or dropdown menu on my grid with roweditor plugin. I would like to know the old value before it was selected. I am using the change listener to do that. However, there are a few ways to select the value. Either you use a mouse click to select (in this case change will be fired) or you can type in and there's an autocomplete.
So in the auto-complete mode, say the actual value is "abc123" and i am typing "ab" it will show a potential match. So i normally just do a tab and the full value gets populated. So in this case, i am unable to get the old value. Could it be that change event is not fired? Any advise on how to handle non mouse-click selection?
field: {
xtype: 'combobox',
id: "namecombo",
typeAhead: true,
triggerAction: 'all',
selectOnTab: true,
store: userstorecombo,
displayField: 'fullname',
//valueField: 'productid',
lazyRender: true,
allowBlank:false,
listClass: 'x-combo-list-small',
msgTarget: 'side',
queryMode: 'local',
listeners: {
scope: this,
select: function(field, value, options)
{
selected_combo_display=field.getRawValue();
},
change: function (field, newValue, oldValue, options) {
selected_combo_display=newValue;
selected_combo_display_old=oldValue
}
}//end listener
}