PDA

View Full Version : REST PARAMETERS



khebrela
27 Sep 2011, 3:23 AM
Hi,

I want to pass parameter to rest service via URL, so can u help me out


Ext.define('somemodel', { extend: 'Ext.data.Model',
fields : ['noteText', 'createdDate', 'modifyUser'],
proxy: {
type: 'rest',
reader: {
root: 'list',
totalProperty: 'count'
},
url : '/proj/rest/asd/note',
noCache : false
}
});

where and what should I put to pass for example "ID" parameter to service ?

thanks :)

skirtle
27 Sep 2011, 3:38 AM
Lots of ways you might do this. Are the parameters dynamic or fixed for a given proxy? Which actions do you want them on? Give as much relevant info a you can.

One way is extraParams:

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.proxy.Rest-cfg-extraParams

khebrela
27 Sep 2011, 3:45 AM
I know that there are "Lots of ways to do this", i want single example , if u could write down simple object (the one u mentioned) for example that passes "ID" to rest , it must be dynamic so i could pass it from another function