-
17 Jan 2011 8:46 AM #1
read json data with model
read json data with model
Hey guys,
i'm trying to read json data from server with a Ext.regModel component. The examples from Sencha API Documentation are not useful for me. The json response i get, contains a other structure. How can i parse a structur like this.thanksCode:{ "car":{ "id":"971", "distance":null, "expires":"2011-02-28 22:59:00", "remaining":null, "remaining_interval":"20000", "isbookmarked":"0", "url":"....", "customer":{ "id":"794", "icon":"...", "title":"..." }, "affiliate":{ "id":"30", "icon":"...", "title":"..." }, "title":"BMW", "description":".....", "image":"...." }
-
19 Jan 2011 8:56 AM #2
additional information:
my Problem ist to read/parse the "customer" Object in this Json structure.
i use currently a "regModel" to pars the Car Object and that looks fine for me.Code:[ { "car":{ "id":"253", "distance":"...", "expires":"...", "customer":{ "id":"175", "title":"...." }, "affiliate":{ "id":"1", "title":"...." }, "title":"BMW", "image":"....gif" } },{ "car":{ "id":"955", "distance":"...", "expires":"...", "customer":{ "id":"780", "title":"...." }, "affiliate":{ "id":"30", "title":"...." }, "title":"Audi", "image":"..." } }]
but how get i access to the customer and affiliate object?Code:Ext.regModel('CarList', { fields: ['title', 'image', 'distance', 'expires', 'id']
i tryed to set customer.title in the "reg.Model" and figure out that the "car" object actually contains the customer.title value but i can not access to this via the tpl tag of my "Ext.list".
Code:{(customer.title)}
Similar Threads
-
store read data from Json Data
By szxiaoyin in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 10 May 2010, 3:44 AM -
can to read json data
By starstar in forum Ext 3.x: Help & DiscussionReplies: 23Last Post: 30 Dec 2009, 7:45 AM -
How to read json data ?
By sapatel in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 25 Mar 2009, 12:31 PM -
How to read JSON Data into a grid
By sonic64 in forum Ext 1.x: Help & DiscussionReplies: 5Last Post: 4 Apr 2007, 7:28 AM -
JSON Data Model?
By cobnet in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 1 Mar 2007, 1:16 AM


Reply With Quote