-
23 May 2012 4:16 AM #1
how to Parse JSON object and bind to dataview
how to Parse JSON object and bind to dataview
Hi i am not able to bind PromoUrl value to itemTpl, i have this value in JSON. how to do this one. please any one can help me. how to fix this problem
Here is my code:
Here is my Json:Code:Ext.define("GS.view.Twitter", { extend: 'Ext.navigation.View', xtype: 'twitter', requires: [ 'Ext.data.JsonP' ], config: { title: 'Blog', iconCls: 'star', items: { xtype: 'dataview', itemTpl: '{PromoUrl}', title: 'Recent Posts', store: { autoLoad: true, fields: ['PromoUrl'], proxy: { type: 'jsonp', url: 'MyUrlpathlink', reader: { type: 'json', rootProperty: 'd' } } } } } });
Code:{ "d" : { "CompanyId" : 1, "ExceptionId" : 0, "PromoUrl" : "videos/Wildlife.mp4", "__type" : "Company:#ABC" } }
-
25 May 2012 5:41 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
d should be an array. You are using JSONP so is the JSON wrapped in a callback method that makes it JSONP?
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.
-
27 May 2012 12:47 AM #3


Reply With Quote