开发者

extjs datastore send to server (datastore -> json)

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.


(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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜