Init from object

</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Init from object</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<script>
		var myRibbon;
		var data = {
			parent: "ribbonObj",
			icons_path: "../common/",
			items: [
				{
					type:'block', text:'office document', list:[
						{id: "group_1", type: "group", list: [
							{id: "open", type:"buttonSegment", text:"Open", img: "48/open.gif"},
							{id: "print",type:"buttonSegment", text:"Print" , img: "48/printer.png"},
							{id: "preview",type:"buttonSegment", text:"Preview", img: "48/zoom_selection.png"}
						]},
						{ id: "group_2", type: "group", list: [
							{"id": "copy", "type":"buttonSegment", "text":"copy", "img": "48/copy.gif"},
							{"id": "find", "type":"buttonSegment", "text":"find" , "img": "48/page_find.png", state: true},
							{"id": "go_to", "type":"buttonSegment", "text":"go to" , "img": "48/tab_go.png"}
						]},
						{type: "newLevel"},
						{"id": "bold", "type":"buttonSegment", "text":"bold", "img": "18/text_bold.png"},
						{"id": "italis","type":"buttonSegment", "text":"italic" , "img": "18/text_italic.png" },
						{"id": "strikethrough","type":"buttonSegment", "text":"strikethrough", "img": "18/text_strikethroungh.png" }
					]
				}
			]
		};

		function doOnLoad() {
			myRibbon = new dhtmlXRibbon(data);
		};

		function doOnUnload() {
			if (myRibbon) {
				myRibbon.unload();
				myRibbon = null;
			}
		};
	</script>
</head>
<body onload="doOnLoad();" onunload="doOnUnload();">
	<div id="ribbonObj"></div>
</body>
</html>

Documentation

Check documentation to learn how to use the components and easily implement them in your applications.