Advanced User Interface Controls and Components

IntegralUI Web

Documentation and API Reference


Gets the level of item in tree hierarchy.


itemObjectThe item for which the level is requested

Return Value

A 0-based number that represents the level of the item in tree hierarchy.

Version Information

Supported in: v1.0.


In this example we are showing how to call getItemLevel method. If item is present in tree hierarchy, an alert box will pop-up with message stating the level.

$(document).ready(function() {

// Create an instance of TreeView widget

var $tree = $('#treeview').treeview();


var showLevel = function(){

var item = $tree.treeview("findItemByText", 'Item231');

if (item){

var level = $tree.treeview("getItemLevel", item);

alert("The level for item " + item.text + " is " + level);




<!DOCTYPE html>



<link rel="stylesheet" href="css/integralui.treeview.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.treeview.min.js"></script>



<div id="treeview" class="widget">







<li data-expanded=false><span>Item23</span></li>



<li data-expanded=false><span>Item232</span>












<li data-expanded=false><span>Item3</span></li>













width: 300px;

height: 300px;


See Also