Configuration object helps programmers avoid writing code, instead, they could make trees like building block. This demo show you how to make a tree with in only
2 lines, and throw structure and tree data into a configuation file.
JSON(Javascript Object Notation) is supported by SkyTree v2.0 to store node structure and data. To view more about JSON,
click here.
var dataJSON = {
items:[
{
text:'Personal Folders',
iExp:'../Images/Menu/oMailbox.gif',
iCol:'../Images/Menu/oMailbox.gif',
iLeaf:'../Images/Menu/oMailbox.gif',
items:[
{
text:'Deleted Items(6)',
iExp:'../Images/Menu/oRecycle.gif',
iCol:'../Images/Menu/oRecycle.gif',
iLeaf:'../Images/Menu/oRecycle.gif',
value:'Deleted Items'
}
,
{
text:'Drafts',
iExp:'../Images/Menu/oDrafts.gif',
iCol:'../Images/Menu/oDrafts.gif',
iLeaf:'../Images/Menu/oDrafts.gif',
value:'Drafts'
}
,
{
text:'Inbox(14)',
iExp:'../Images/Menu/oInbox.gif',
iCol:'../Images/Menu/oInbox.gif',
iLeaf:'../Images/Menu/oInbox.gif',
items:[
{
text:'Invoices',
iExp:'../Images/Menu/folder.gif',
iCol:'../Images/Menu/folder.gif',
iLeaf:'../Images/Menu/folder.gif',
value:'Invoices'
}],
value:'Inbox'
}
,
{
text:'Junk E-mail',
iExp:'../Images/Menu/folder.gif',
iCol:'../Images/Menu/folder.gif',
iLeaf:'../Images/Menu/folder.gif',
value:'Junk E-mail'
}
,
{
text:'Outbox',
iExp:'../Images/Menu/oOutlook.gif',
iCol:'../Images/Menu/oOutlook.gif',
iLeaf:'../Images/Menu/oOutlook.gif',
value:'Outbox'
}
,
{
text:'Sent Items',
iExp:'../Images/Menu/oSent.gif',
iCol:'../Images/Menu/oSent.gif',
iLeaf:'../Images/Menu/oSent.gif',
value:'Sent Items'
}
,
{
text:'Search Folders',
iExp:'../Images/Menu/oSearch.gif',
iCol:'../Images/Menu/oSearch.gif',
iLeaf:'../Images/Menu/oSearch.gif',
items:[
{
text:'Form Follow Up',
iExp:'../Images/Menu/oSearchF.gif',
iCol:'../Images/Menu/oSearchF.gif',
iLeaf:'../Images/Menu/oSearchF.gif',
value:'Form Follow Up'
}
,
{
text:'Large Mail',
iExp:'../Images/Menu/oSearchF.gif',
iCol:'../Images/Menu/oSearchF.gif',
iLeaf:'../Images/Menu/oSearchF.gif',
value:'Large Mail'
}
,
{
text:'Unread Mail',
iExp:'../Images/Menu/oSearchF.gif',
iCol:'../Images/Menu/oSearchF.gif',
iLeaf:'../Images/Menu/oSearchF.gif',
value:'Unread Mail'
}],
value:'Search Folders'
}],
value:'Personal Folders'
}]
}
var cfgJSON = {
basePath : '../',
singleExpand : false,
hintBeforeDelete : false,
lang : 'en',
checkName : 'chkDemo',
defMethod : 'alert("Node Index : " + {$NODE}.index)',
expandLevel : 2,
autoCheck : true,
tempData : dataJSON
}