CodeThatTree - Tree Actions Example

CodeThatTree - Tree Actions Example

 

var TreeDef = {
	"style" :
	{
		"imgitem" : "img/ats.gif", // Image for leafs
		"imgdir" : "img/atg.gif", // Image for directories
		"imgdiropen" : "img/ato.gif", // Image for directories in open state
		"itemoffset" : {
			"x" : "10", "y" : "0"
		}
		// Offset for a next tree level
	},
	"position" : {
		"absolute" : true, "pos" : [10, 10]
	},
	// Main items array. In this case has one item Item1
	"items" : [
	{
		"text" : "Item0",
		// Subtree definition
		"menu" :
		{
			// Subitems array.
			"items" : [ {
				"text" : "Visit CodeThat.com!",
				"action" :
				{
					"url" : "http://www.codethat.com",
					"target" : "_blank"
				}
			},
			{
				"text" : "Call Alert!",
				"action" :
				{
					"js" : "alert('Alert called!');"
				}
			},
			{
				"text" : "Go to Google.com",
				"action" :
				{
					"url" : "http://www.google.com"
				}
			} ]
		}
	} ]
};