PDA

View Full Version : WebService Call from Store



Sneha004
20 Mar 2012, 4:36 AM
Hi All,

I have a problem on connecting webservice to store in .js file.
In store, My code is as follows :

Ext.define('VehicleStore', {
extend : 'Ext.data.Store',
model:'vehicle',
type:'JsonP',
url:'webserviceUrl',
});

when I wrote JsonP as type, it shows error.
What should I wrtie for type ?
and the url which contains the parameters and values , those parameters should I define in model ?

Please give solution to me.
I am not getting how to do this webservice call in .js file and the entire flow.

Thanks in Advance..

chramer
20 Mar 2012, 5:04 AM
Ext.define('VehicleStore', {
extend: 'Ext.data.Store',
model: 'vehicle',
proxy: {
type: 'JsonP',
url: 'webserviceUrl',
}
});

Sneha004
20 Mar 2012, 8:02 PM
Thanks chramer,

I have written proxy , but its not working....

Whats the reason , please clarify....:(

chramer
20 Mar 2012, 9:33 PM
Ext.define('VehicleStore', {
extend: 'Ext.data.Store',
model: 'vehicle',
autoLoad: true,
proxy: {
type: 'JsonP',
url: 'webserviceUrl',
reader: {
type: 'json',
root: 'data'
}
}
});