PDA

View Full Version : combobox drop down arrow click event?



santosh.kumar
15 Feb 2013, 4:03 PM
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

sword-it
15 Feb 2013, 10:37 PM
Hi,

you can use following 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'
})
}

santosh.kumar
19 Feb 2013, 10:47 AM
I am getting "cannot call method 'indexOf' of undefined' when i used your suggestion. here is my 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.

santosh.kumar
19 Feb 2013, 12:50 PM
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.