BWolf
BWolf

Reputation: 23

Ext JS auto complete field with additional post variables

I am using an Ext JS ComboBox like in this Example: stackoverflow: How would one do html input tag autocomplete in Ext.js?

It works perfect for sending a simple query over POST to the server. (Firebug output: query=smth)

But now I have a bit different use case. I want to send some additional information to the server. Something like: query=smth&variableId=8&someMore=XY.

Of course I could just add the variables to the URL of the JsonStore and send it over GET. But I am wondering if there is something like a params object where I can specify my custom variables and which will be considered for the request.

Thank you for your time.

Upvotes: 2

Views: 1052

Answers (1)

Mchl
Mchl

Reputation: 62395

Yes. You can define your store with

baseParams: {
   thisWillBeAddedToEachRequest: 'foo'
}

Or you can use beforeload listener

listeners: {
  beforeload: funciton(store) {
    store.setBaseParam('paramToBeSetBeforeEachRequest',someVariable);
  }
}

Upvotes: 3

Related Questions