Advanced User Interface Controls and Components
Searches through all groups for a match using specified id.
Param | Type | Details |
---|---|---|
id | String | The group id value to search for |
If successful, the group object that contains the specified id, otherwise null.
Supported in: v1.0.
In this example we are searching for a group with id value set to '2'. If group is found an alert box will pop-up with a message.
$(document).ready(function() {
// Create an instance of Accordion widget
var $bar = $('#accordion').accordion();
var searchGroups = function(){
var group = $bar.accordion("findGroupById", '2');
if (group)
alert("Group that matches specified criteria is: " + group.text);
}
});
<!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>
<button type="button" id="search" onclick="searchGroups()" />Search Groups</button>
<div id="accordion" class="widget">
<h3 id="1" ><span>Books</span></h3>
<div></div>
<h3 id="2" ><span>Electronics</span></h3>
<div></div>
<h3 id="3" ><span>Music</span></h3>
<div></div>
<h3 id="4" ><span>Science</span></h3>
<div></div>
<h3 id="5" ><span>Sports</span></h3>
<div></div>
</div>
</body>
</html>
.widget
{
width: 300px;
height: 300px;
}