Advanced User Interface Controls and Components
Removes an item at specified position in Menu widget.
Param | Type | Details |
---|---|---|
index | Integer | The indexed location within the collection to remove an item from |
parent (optional) | Object | The parent item from which an item will be removed |
This method does not return a value.
Supported in: v1.0.
In this example we are showing how to use removeItemAt method to remove an item at position 1. In this case because parent item is not specified, the item will be removed from root items collection. If there is no item at specified position, nothing will happen.
$(document).ready(function() {
// Create an instance of Menu widget
var $bar = $('#menu').menu();
$bar.menu("removeItemAt", 1);
});
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/integralui.menu.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.menu.min.js"></script>
</head>
<body>
<div id="menu" class="widget">
<ul>
<li><span>MenuItem1</span></li>
<li><span>MenuItem2</span>
<ul>
<li><span>MenuItem21</span></li>
<li>><span>MenuItem22</span></li>
<li ><span>MenuItem23</span></li>
<ul>
<li><span>MenuItem231</span></li>
<li ><span>MenuItem232</span>
<ul>
<li><span>MenuItem2321</span></li>
<li><span>MenuItem2322</span></li>
</ul>
</li>
<li><span>MenuItem233</span></li>
</ul>
</li>
<li><span>MenuItem24</span></li>
</ul>
</li>
<li ><span>MenuItem3</span></li>
<ul>
<li><span>MenuItem31</span></li>
<li><span>MenuItem32</span></li>
<li><span>MenuItem33</span></li>
</ul>
</li>
</ul>
</div>
</body>
</html>
.widget
{
width: 600px;
height: 0;
}
A sample which demonstrates how you can create and/or modify a tree hierarchy using several different methods.