1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Answers
    1
    Vote Rating
    0
    santosh.kumar is on a distinguished road

      0  

    Default Answered: combobox drop down arrow click event?

    Answered: combobox drop down arrow click event?


    hi,

    Is there a drop down click event in combo box? I want to load data into combo box only when dropdown is opening.

    Note: i am using a webservice from different domain, so, i guess ajax call from store does not work.

    Thanks
    Santosh

  2. Solved it... I am using 'expand' event of combo box to make Ext.Ajax cross domain request and load the local store of combo box.

  3. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi,

    you can use following code:

    Code:
    {
       xtype:'combo'
       , hiddenName:'Status'
      , displayField:'Name'
      , ValueField:'value'
      , querryMode:'remote'
      , triggerAction:'all'
      , typeAhead:true
      , store: new Ext.data.JsonStore({
          url:'you webserviec url'
         , autoLoad:true
         , fields:['Name','Value']
        , root:'Item'
    })
    }
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  4. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Answers
    1
    Vote Rating
    0
    santosh.kumar is on a distinguished road

      0  

    Default


    I am getting "cannot call method 'indexOf' of undefined' when i used your suggestion. here is my code:


    Code:
            return Ext.create('Ext.form.ComboBox', {
                value: defaultvalue,
                margin: '3 3 3 3',
                itemId: 'defaultvaluecb',
                triggerAction: 'all',
                queryMode: 'remote',
                store: new Ext.data.JsonStore({
                    url: localhosturl + '/AdminUI/services/AppSetupWizardService.asmx/GetValidationData',
                    autoLoad: true,
                    fields: ['Name', 'Value'],
                    root: 'Item',
                    extraParams: {
                        tableRef: '',
                        fieldRef: '',
                        _authToken: sessiontoken
                    },
                }),
    
    
                displayField: 'displayvalue',
                valueField: 'storevalue'
            });
    when i debugged i found it is looking for proxy type and there is no proxy in the above code for store. I added proxy with type as 'ajax' and other types. But, that didn't help. As i said my webservice is on different domain and i guess thats the issue.

  5. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Answers
    1
    Vote Rating
    0
    santosh.kumar is on a distinguished road

      0  

    Default


    Solved it... I am using 'expand' event of combo box to make Ext.Ajax cross domain request and load the local store of combo box.

Thread Participants: 1