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"
}
}
]}
]