Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In ExtJS, how do I make store.load(config) send parameters not limited to the predefined?

Tags:

extjs

extjs4

I'm performing a remote filter to a store.

I code something like this:

myStore.load({
    limit: 8,
    foo: 'foo is never sent',
    filters:[{'property':'some property','value':30,'comparison':'lt','field':'age'}]
});

It ends up sending to the server using GET method, with parameters below: (from chrome/firebug)

_dc:1327757119914
page:1
start:0
limit:8
filter:[{"property":"some property","value":30}]

requested URL:

myServerPage.php?_dc=1327757119914&page=1&start=0&limit=8&filter=%5B%7B%22property%22%3A%22some%20property%22%2C%22value%22%3A30%7D%5D

the 'foo' is missing, and more importantly, in the passing 'filter' object, only 'property' and 'value' was sent. (I think these two are predefined, filter config does not accept other keys and values)

How can I send my own parameters to the server using load(), especially in the 'filters' part?

like image 898
gfaceless Avatar asked Jan 28 '12 13:01

gfaceless


2 Answers

another way:

myStore.getProxy().extraParams= {search: "something"}
like image 86
dbrin Avatar answered Oct 05 '22 22:10

dbrin


myStore.load({
  params: {
    foo: 'foo'
  }
})
like image 28
Mchl Avatar answered Oct 05 '22 23:10

Mchl