Advanced User Interface Controls and Components
A CSS class which represents a default icon shown for all items that don't have an icon in TreeView.
A String value. The default is '', stating that there is no icon set.
Enables all items can share the same icon. This property accepts as value a CSS class with settings for a custom image.
Supported in: v1.0.
In this example we are showing how to set a default icon used by items which don't have a specific icon set.
$(document).ready(function() {
// Create an instance of TreeView widget
$tree = $('#treeview').treeview({
itemIcon: ""
});
});
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/integralui.accordion.css" />
<link rel="stylesheet" href="css/themes/theme-blue.css" />
<script type="text/javascript" src="external/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="external/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="external/jquery.ui.widget.min.js"></script>
<script type="text/javascript" src="js/jquery.integralui.widget.min.js"></script>
<script type="text/javascript" src="js/jquery.integralui.accordion.min.js"></script>
</head>
<body>
<div id="treeview" class="widget">
<ul>
<li><span>Item1</span></li>
<li><span>Item2</span>
<ul>
<li><span>Item21</span></li>
<li>><span>Item22</span></li>
<li data-expanded=false><span>Item23</span></li>
<ul>
<li><span>Item231</span></li>
<li data-expanded=false><span>Item232</span>
<ul>
<li><span>Item2321</span></li>
<li><span>Item2322</span></li>
</ul>
</li>
<li><span>Item233</span></li>
</ul>
</li>
<li><span>Item24</span></li>
</ul>
</li>
<li data-expanded=false><span>Item3</span></li>
<ul>
<li><span>Item31</span></li>
<li><span>Item32</span></li>
<li><span>Item33</span></li>
</ul>
</li>
</ul>
</div>
</body>
</html>
.widget
{
width: 300px;
height: 300px;
}
.icons
{
background-image: url(../../resources/icons.png);
background-repeat: no-repeat;
display: inline-block;
overflow: hidden;
padding: 0;
margin: 0;
width: 16px;
height: 16px;
}
.empty
{
background-position: 0px 0px;
}
.doc
{
background-position: -64px -48px;
}
A sample which demonstrates how to apply custom icons to each item in TreeView for jQuery.