Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-14-2012, 10:44 AM   PM User | #1
Pablo Valdés
New to the CF scene

 
Join Date: Apr 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Pablo Valdés is an unknown quantity at this point
Load and Store a Json tree structure using backbone

Hello guys, I hope somebody can help me with this.

I have a json tree structure (posted below). What i want to do is read and load it using a MVC model, collection and finally a view to represent it. I am using the backbone framework. I´d be really thankful to anyone who can throw a little light here.

Thanks in advance


PS: Here goes the Json
Code:
[ 
      { attributes: { id : "00001" }, 
				state: "open", 
				data: "Company", 
				children : [
							{ attributes: { 
										id : "00002" }, 
										data: { 
												title : "Planta 1", 
												icon : "../media/images/ok.png",
												alarm:"0",
												latitude:"23476543.8",
												longitude:"3454764534"
											  },
										children:[
										
													{ attributes: { 
										id : "00002-A" }, 
										data: { 
												title : "Zona 1", 
												icon : "../media/images/ok.png",
												alarm:"0",
												cordinateX:"500",
												cordinateY:"700"
											  },
										
												},
												{ attributes: { 
										id : "00002-B" }, 
										data: { 
												title : "Zona 2", 
												icon : "../media/images/ok.png",
												alarm:"1",
												cordinateX:"259",
												cordinateY:"985"
											  },
										
												}
										
												 ]
							},
							{ attributes: { 
										id : "00003" }, 
										data: { 
												title : "Planta 2", 
												icon : "../media/images/ok.png",
												alarm:"0",
												latitude:"23543.8",
												longitude:"3534"
											  } 
							},
							
							{ attributes: { 
										id : "00003" }, 
										data: { 
												title : "Planta 3", 
												icon : "../media/images/ok.png",
												alarm:"1",
												latitude:"2354663.8",
												longitude:"35348765"
											  } 
							}
      ]}
]
Pablo Valdés is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:25 PM.


Advertisement
Log in to turn off these ads.