PDA

View Full Version : Unable to click additional item added to combobox



medha_sn
26 Mar 2014, 5:33 PM
Hi,

I have a combobox that loads items from a store. I am able to add a custom item. My problem is the newly added item is not clickable (unable to select it)

Here is what I have so far:



Ext.define("Store", {
extend: "MI.store.AbstractStore",
storeId: "Store",
model: "Model",
remoteSort: true,
listeners: {
load: function(store) {
store.insert(store.totalCount+1,{id:0, name:'Create New Profile'});
}
}
});

And for the combobox:


xtype: 'combobox',
auto: 'selectProfileCombo',
name: 'profileCombo',
fieldLabel: 'Profile',
displayField: 'name',
valueField: 'id',
emptyText: 'Select Profile',
listConfig: {
listeners: {
itemclick: function(list, record) {
if(record.get('id')== 0){
//handle Create New Profile
}
else{
form.loadRecord(record);
}
}
}


and I load the store in initComponent as :


var store = Store;
combo.store = store.
combo.store.load();

Am I missing anything? Or is there a better way to implement my scenario? Any pointers will be of great help.

Thank you in advance!

israelroldan
2 Apr 2014, 11:11 AM
Which Ext version are you using? This seems to be working fine on 4.2.1: https://fiddle.sencha.com/#fiddle/4nt

fdp
13 Mar 2015, 2:26 AM
This bug still exists, I reported it here:

http://www.sencha.com/forum/showthread.php?299096-Unable-to-select-or-click-additional-items-added-to-combobox