PDA

View Full Version : Request paramter for Store



sridhar.boganathan
13 Mar 2012, 12:46 AM
Hi All,

I am using Model and View objects for grids. I am using AJAX Proxy and XML Reader in it. Here, as per my requirements, I need to make request with request parameters (Eg, Student ID to retrieve list of student's marks). Ofter, I may need to send XML as a parameter (Eg., Webservice request).

I could make my store to contact the server when it is being loaded, I could not send a parameter along with the request.

Here is my store definition


Ext.define('extjspoc.store.MarksList', {
extend: 'Ext.data.Store',
autoLoad: true,

proxy: {
type: 'ajax',
url: 'http://remoteserverurl/webservices/RetrieveStudentsMarks',
reader: {
type: 'xml',
root: 'subjects',
record: 'marks'
}
}
});

Thanks in Advance,
Sridhar

vietits
13 Mar 2012, 12:54 AM
If parameters are fixed for every store request then you should use extraParams config for your proxy. If not, you can use <store>.load({params: {...}}).

sridhar.boganathan
13 Mar 2012, 5:57 AM
Thanks,

The same way, I have to send XML string as a obejects to store objects. Is this possible.

Regards,
Sri

vietits
13 Mar 2012, 6:09 AM
With xml reader, your server script needs to return data in XML format. All other things such as parsing data, populate it to store will be done automatically for you.