-
21 Nov 2012 7:11 AM #1
Passing store data to server side
Passing store data to server side
Hi there,
I have a grid whose store definition is as follows
Code:this.store = new Ext.data.JsonStore({ autoload : false, idProperty : 'groupID', root : 'Name_report', totalProperty : 'count', successProperty : 'success', messageProperty : "msg", autoScroll:true, fields : [ { name : 'entityID' },{ name : 'groupID' }, { name : 'groupName' }, { name : 'originalName' }, { name : 'standardName' } ], remoteSort : false, proxy : new Ext.data.HttpProxy({ url : QUERY_URL +"?type=NAME", defaultHeaders : { Accept : 'application/json' }, method : 'post', disableCaching : false }) });
I want to send the json representation of the store data to the server for generating reports. Is there any way I can do that ?
-
21 Nov 2012 7:27 AM #2
I'm not sure I understand what you want to send to the server?
Can you give an example of what you expect to send?
-
21 Nov 2012 7:53 AM #3
I need to pass the data contained in the store
-
21 Nov 2012 8:02 AM #4
You need to pass the entire dataset held in the store? I'm not sure why you would need to do that - since it must already be populated by a call to a DB anyway?
Why are you wanting to send every record?
-
21 Nov 2012 8:06 AM #5
That's what I need to know, how can I pass the entire data set. I can't query the DB again because in sme cases the query takes time to fetch the results and hence I don't want to query the DB again to fetch the data. Hence I need to pass the data which is contained in the store as JSON or some other format to the server to generate PDF.
-
21 Nov 2012 8:18 AM #6
Yes, this is possible.
Then simply pass the str variable during your call to create the report.Code:// GRAB THE DATA OBJECT var data = store.reader.jsonData; // CONVERT TO JSON STRING var str = Ext.util.JSON.encode(data.Name_report);
-
21 Nov 2012 9:04 AM #7


Reply With Quote