Question

Getting Json from the Server and displaying it in the grid is relatively straight forward. In the application (http://pssnet.com/~devone/extjs3/loadSelection5.html) I generate a dynamic grid datastore. I need to send this to the Server for further processing.

If there is a way to convert the data store to json, I can strigyfy it and send it a param...as in jQuery.

Otherthan looping through the whole datastore to build json, there seems no methods.

Thank you.

Was it helpful?

Solution

(I can guarantee that the following applies to Ext > 2.3)

Because Ext.data.Store stores an array of Ext.data.Record objects, it has no direct access to the underlying data (Ext.data.Record encapsulates the data), so, indeed, there's no direct way to do it. But Ext.data.Record itself has a public property called "data" (an object with the field:value properties), which you can collect into an array (e.g. using the Ext.data.Store#each method) and then encode with Ext.encode() to "stringify" it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top