PDA

View Full Version : how to get type in json file without using tpl



wawan678
5 Jan 2011, 11:29 PM
this is my json file
{
text: 'root',
type: 'root',
id: 'root',
expanded: true,
children: [{
text: 'child 1',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'file',
children: [{
text: 'folder2',
type: "folder",
children: [{
text: "file2",
type: "file",
leaf: true
},{
text: "folder21",
type: "folder",
leaf: true
}]
},{
text: "folder3",
type: "folder",
children: [{
text: "file4",
type: "file",
leaf: true
}]
}]
},{
text: 'child 2 dari child 1',
type: 'file',
leaf: true
}]
},{
text: 'child 2',
type: 'file',
leaf: true
},{
text: 'child 21',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'file',
leaf: true
}]
}]
}]
}]},{
text: 'child 2 dari child 1',
type: 'file',
leaf: true
}]
}
how to get type of each text without using tpl..please help me..
i'm sorry if my english is bad..

10 Jan 2011, 6:20 AM
this is my json file

{
text: 'root',
type: 'root',
id: 'root',
expanded: true,
children: [{
text: 'child 1',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'file',
children: [{
text: 'folder2',
type: "folder",
children: [{
text: "file2",
type: "file",
leaf: true
},{
text: "folder21",
type: "folder",
leaf: true
}]
},{
text: "folder3",
type: "folder",
children: [{
text: "file4",
type: "file",
leaf: true
}]
}]
},{
text: 'child 2 dari child 1',
type: 'file',
leaf: true
}]
},{
text: 'child 2',
type: 'file',
leaf: true
},{
text: 'child 21',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'folder',
children: [{
text: 'child 1 dari child 1',
type: 'file',
leaf: true
}]
}]
}]
}]},{
text: 'child 2 dari child 1',
type: 'file',
leaf: true
}]
}
how to get type of each text without using tpl..please help me..
i'm sorry if my english is bad..


Please post code within code tags in the future!