Results 1 to 4 of 4

Thread: Adding a "show all" option to a combobox+store

  1. #1
    Sencha User
    Join Date
    Oct 2009
    Posts
    15

    Question Adding a "show all" option to a combobox+store

    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:

    Code:
    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:

    Code:
    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

  2. #2
    Sencha User
    Join Date
    Oct 2009
    Posts
    15

    Default

    really nobody knows?

  3. #3
    Ext User
    Join Date
    May 2010
    Location
    india Bangalore
    Posts
    186

    Default

    hi,


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

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    What's the question?

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •