Reputation: 1013
I have an Extjs application that uses a lot of combo boxes (with attached service calls). Each of these combo's has a rest store attached to it which provides it with a way to get the data from the server.
My problem is that, even though autoLoad is false on all of the stores, there are multiple rest calls per instance of these combo boxes.
I would like to, either:
Find a way to limit the store to just 1 call (by configuration) -- there is no need for more than 1 call, the data doesn't change that often
Find a way to change the store's proxy from a rest proxy to a memory proxy after the first load -- which would allow the combo to do as many load()'s as it wants, there will be no more calls to the server.
EDIT: To illustrate how my combo's are created:
Ext.define('SelectBox', {
extend : 'Ext.form.field.ComboBox',
alias : 'widget.selectBox',
editable : false,
allowBlank : true,
displayField : 'label',
valueField : 'value',
forceSelection : true,
minChars : 1,
queryMode: "local" //added this after the answer was given
});
And I call them with:
{
xtype:"selectBox",
store: "someStore"
}
Upvotes: 0
Views: 578
Reputation: 25031
You essentially have to set the combo's queryMode
to local in order for filtering operation to happen on the client-side. No need to mess with the proxy. And your combos will be a tad more reactive too!
See the example in the second part of this previous answer.
For this to work, you must also ensure that you store's remoteFilter
(and possibly remoteSort
) options are set to false.
Upvotes: 1