ytppa
15 Dec 2011, 1:04 AM
I declare my ComboBox:
var s_f_uch = new Ext.form.ComboBox({
xtype: 'combo',
allowBlank: false,
editable: false,
triggerAction: 'all',
typeAhead: false,
width:180,
store: [ ['1',item1], ['2','item2'], ['3','item3'] ],
fieldLabel: 'label',
queryMode: 'local',
name: 'uch',
emptyText: 'select..'
});
I have some items in my form and, when page is loaded, i put my combobox instead of one item in this form:
switchCombo = function(id) {
var field = searchForm2.items.get(6);
if (searchForm2.remove(field)) {
searchForm2.insert(6,{
layout: 'anchor',
fieldDefaults: {
labelAlign: 'top'
},
frame: true,
border: false,
baseCls:'x-plain',
items:[s_f_uch]
});
searchForm2.doLayout();
};
switchCombo();
}
first time, when page loaded, function puts combobox in right place and combobox works good, then i call my function again (switchCombo() ) and it remove an item correctly, then puts on it's place combobox again, but there is no expanding list in it..can't not select anything.
var s_f_uch = new Ext.form.ComboBox({
xtype: 'combo',
allowBlank: false,
editable: false,
triggerAction: 'all',
typeAhead: false,
width:180,
store: [ ['1',item1], ['2','item2'], ['3','item3'] ],
fieldLabel: 'label',
queryMode: 'local',
name: 'uch',
emptyText: 'select..'
});
I have some items in my form and, when page is loaded, i put my combobox instead of one item in this form:
switchCombo = function(id) {
var field = searchForm2.items.get(6);
if (searchForm2.remove(field)) {
searchForm2.insert(6,{
layout: 'anchor',
fieldDefaults: {
labelAlign: 'top'
},
frame: true,
border: false,
baseCls:'x-plain',
items:[s_f_uch]
});
searchForm2.doLayout();
};
switchCombo();
}
first time, when page loaded, function puts combobox in right place and combobox works good, then i call my function again (switchCombo() ) and it remove an item correctly, then puts on it's place combobox again, but there is no expanding list in it..can't not select anything.