Mike
Mike

Reputation: 1013

Extjs 4.1: Multiple ajax calls per combo

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:

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

Answers (1)

rixo
rixo

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

Related Questions