I am making a combobox in EXTJS which should be populated by a REST service. Like this example: http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/form/forum-search.html
I want to make a call like this:
https://smartadresse.dk/service/locations/3/detect/json/granskoven%20glostrup?apikey=1E718C7E-70D7-4E3A-AB40-AF6671FDCB57
But it makes it like this:
https://smartadresse.dk/service/locations/3/detect/json/?apikey=1E718C7E-70D7-4E3A-AB40-AF6671FDCB57&query=granskoven%20glostrup
How do you tell extjs to change that? My Ext proxy looks like this:
proxy: {
type: 'jsonp',
url : 'https://smartadresse.dk/service/locations/3/detect/json/',
extraParams: {
apikey: '1E718C7E-70D7-4E3A-AB40-AF6671FDCB57',
},
reader: {
type: 'json',
root: 'streetName'
},
I have also noticed that you aren't actually using the type: 'rest'
in your proxy, but the jsonp one as type: 'jsonp'
. Do you need to be going to a different domain with your call? If not, you should change the type to rest to see if it is implemented in the way you expect.
JSONP has actually nothing to do with the REST protocol, it is for going to different domains than were your page is hosted. JSONP works like a regular ajax call in that all the actions and parameters are sent as post data or on the url by your configuration. From the documentation though, it appears that you could get what you want by using the api
configuration option which has methods for CRUD which should be very similar.