PDA

View Full Version : Adding a "show all" option to a combobox+store



seltzlab
7 Feb 2010, 8:58 AM
Hi all, I have a combobox binded to a store. When I click an option a dataview below is filtered.
Here's a sample of what I'm doing:


new Ext.form.ComboBox({
id: 'mycombo',
typeAhead: true,
mode: 'local',
store: mycombo_store,
triggerAction: 'all',
valueField: 'id',
tpl: mycombo_tpl,
editable: false,
listeners: {
select: function(combo, record, index) {
var store = Ext.getCmp('mydataview').getStore();
store.filterBy(function(currentrecord, id) {
if (currentrecord.data.isgood == record.data.isgood)
return true;
else
return false;
});
},
}
})
I'd like to know if there's a way to put a "show all" option in the combobox before the options taken from the mycombo_store.
I've tried to put it in the tpl in this way:


mycombo_tpl = new Ext.XTemplate('<div class="x-combo-list-item">Show all</div><tpl for="."><div class="x-combo-list-item">{name} ({sex})</div></tpl>');but it seems that the combo selection index crash: I select an option and combobox show me the next one.

Anybody knows the trick?

Regards,
Antonio

seltzlab
11 Feb 2010, 3:46 AM
really nobody knows?

mayurid
17 Jun 2010, 2:05 AM
hi,


did u find solution to show all.. if yes wat is it?

Animal
17 Jun 2010, 2:33 AM
What's the question?

Because I can't make much sense of the OP. "the combo selection index crash"?????????