Results 1 to 2 of 2

Thread: ComboBox Select Listener

  1. #1

    Default ComboBox Select Listener

    I'm trying to add a select listener to a combo box like this:

    Code:
    new Ext.form.ComboBox(
            {
                typeAhead: true,
                mode: 'local',
                selectOnFocus: true,
                triggerAction: 'all',
                displayField: 'description',
                valueField: 'origin',
                store: Exs.Data.storeOrigins,
                listeners:
                {
                    select: function (cmb, record, index)
                    {
                        alert("index: " + index);
                    }
                }
            }),
    The listener function is invoked but the arguments passed to the listener function (cmb, record, index) are always undefined. I also tried using the addListener method with the same results. From the documentation I would expect those three arguments to be passed to my listener function:
    Code:
    select  : ( Ext.form.ComboBox combo, Ext.data.Record record, Number index )
    So What is it I am doing wrong?

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    it works for me:

    Code:
    var combo = new Ext.form.ComboBox({
        store : ['1','2','3'],
        listeners : {
            select : function() {
                console.log(arguments);
            }
        }
    
    });
    
    new Ext.Window({
        height : 100,
        width : 200,
        items : combo
    }).show()
    Oh, and you should google firebug. Developing with alerts is so inefficient

Posting Permissions

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