Custom template 2
</> Source
<!DOCTYPE html>
<html>
<head>
<title>Custom template 2</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>
<style>
div#sidebarObj {
position: relative;
margin-left: 10px;
margin-top: 10px;
width: 600px;
height: 450px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.09);
}
.dhxsidebar_tpl_myview div.dhxsidebar_item {
height: 53px;
line-height: 53px;
}
.dhxsidebar_tpl_myview img.dhxsidebar_item_icon {
left: 8px !important;
top: 11px !important;
}
.dhxsidebar_tpl_myview div.line_one {
margin-left: 51px;
margin-top: 9px;
line-height: 16px;
font-size: 1em;
}
.dhxsidebar_tpl_myview div.line_two {
margin-left: 51px;
margin-top: 3px;
line-height: 16px;
font-size: 0.95em;
color: #999;
}
</style>
<script>
var mySidebar;
function doOnLoad() {
mySidebar = new dhtmlXSideBar({
parent: "sidebarObj",
icons_path: "../common/icons_material/32/",
template: "myview",
width: 150,
items: [
{id: "a1", text: "Documents", text2: "2 objects", icon: "documents.png", selected: true},
{id: "a2", text: "Music", text2: "16 objects", icon: "music.png"},
{id: "a3", text: "Pictures", text2: "1 object", icon: "pictures.png"},
{id: "a4", text: "Video", text2: "Empty", icon: "video.png"}
]
});
}
dhtmlXSideBar.prototype.templates.myview =
// icon 32x32
"<img class='dhxsidebar_item_icon' src='#icons_path##icon#' border='0'>"+
// general area for text
"<div class='dhxsidebar_item_text'>"+
"<div class='line_one'>#text#</div>"+ // 1st line of text
"<div class='line_two'>#text2#</div>"+ // 2nd line of text
"</div>";
</script>
</head>
<body onload="doOnLoad();">
<div id="sidebarObj"></div>
</body>
</html>
Documentation
Check documentation to learn how to use the components and easily implement them in your applications.