PDA

View Full Version : Loading combobox store - method POST and GET.



muncher
30 Aug 2010, 8:59 AM
When I populate a combobox with mode: 'local' it does only GET request and when I use mode:'remote' it does both, GET once and POST once ?

Is that the expected behaviour or I have messed up something else ?

Oh yea, I am using superselectbox, would that be a prob ?

some code snippet -


Ext.myApp.form.ComboBox.MContactCombo= Ext.extend(Ext.ux.form.SuperBoxSelect, {
initComponent : function(config) {
Ext.apply(this, {
store : new Ext.myApp.form.ComboBox.CrapStore(),
displayField : 'name',
displayFieldTpl: '{name}',
valueField : 'id',
name:'name',
hiddenName : 'name',
typeAhead : true,
mode : 'local',
fieldLabel : 'Contacts',
anchor : '70%',
forceSelection : true,
triggerAction : 'all',
emptyText : 'Select one or more Contacts...',
hideOnSelect:false,
selectOnFocus : true
}); // end of ext.apply
Ext.myApp.form.ComboBox.MContactCombo.superclass.initComponent.apply(
this, config);
this.getStore().load();
} // end of initcomponent
}); // end of Multi-SelectContactCombo
is that because of this.getStore.load() that I see it sending two requests, when mode is remote ?

muncher
30 Aug 2010, 9:09 AM
adding this one to store, solves the problem -


......
proxy: new Ext.data.HttpProxy({
url: URL_CONTACTS,
method: 'GET'
}),
......