PDA

View Full Version : combobox request



kyousuke
29 Aug 2011, 1:30 AM
version: extjs4
My comboBox is autoload and when I click the combobox's button, it request the server again.
I wish when I click the combobox's button, it doesn't request the server. How to do it?


Ext.define("dflModel", {
extend: "Ext.data.Model",
fields: [
{name: "dflDm", type: "string"},
{name: "dflMc", type: "string"}
]
});

var store = Ext.create("Ext.data.Store", {
firstLoad: true,
model: "dflModel",
proxy: {
url: "<%=basePath%>servlet/dfl",
type: "ajax"
},
autoLoad: true
});

Ext.create("Ext.form.field.ComboBox", {
renderTo: Ext.getBody(),
store: store,
displayField: "dflMc",
valueField: "dflDm"
});

skirtle
30 Aug 2011, 5:34 AM
Add queryMode: 'local' to the combobox config.

kyousuke
30 Aug 2011, 5:10 PM
Add queryMode: 'local' to the combobox config.
I did it, but no effect. It still requested again when I clicked the combobox's button

skirtle
30 Aug 2011, 5:30 PM
Please double-check you've put this option in the right place and spelt it correctly: it definitely fixes it for me. It should be on the combobox, not the store.

Also make sure you aren't using a cached copy of the JS files.

kyousuke
30 Aug 2011, 6:30 PM
Please double-check you've put this option in the right place and spelt it correctly: it definitely fixes it for me. It should be on the combobox, not the store.

Also make sure you aren't using a cached copy of the JS files.

Thanks!!!!!!!!