-
12 Mar 2012 1:44 AM #1
Store.load callback function problem
Store.load callback function problem
I am using the following snippet in my code:
This retrieves data passed from the server in JSON format and loads it into the form panel.Code:store.load({ params:{paramMap}, callback : function(records, options, success) { if (success) { var form = formPanel.getForm(); var jsonStr = Ext.JSON.encode(records[0].raw); var jsonObj = Ext.JSON.decode(jsonStr); form.loadRecord(jsonObj); } } });
The callback function loads records with raw data. The data fields remain empty. Hence i have to use encode and decode to get the records in the right format.
Please help me in understanding why the records raw data is populated and not the data.
Am i going wrong somewhere??
Thanks
RabiLast edited by mitchellsimoens; 12 Mar 2012 at 6:40 AM. Reason: added [CODE] tags
-
12 Mar 2012 6:41 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
loadRecord is expecting a model instance not an object
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
12 Mar 2012 9:15 PM #3
loadrecord() works fine above...the doubt i have is regarding records[0].raw.
The records data should be populated, but i can only see raw data populated
Help


Reply With Quote