Advanced User Interface Controls and Components

IntegralUI Web

Documentation and API Reference

insertGroupBefore(group, refGroup)

Inserts a new group at position before specified group in Accordion widget.


groupObjectThe group to add to the collection
refGroup ObjectA reference group before which the newly added group will be positioned

Return Value

This method does not return a value.

Version Information

Supported in: v1.0.


In this example we are showing how to use insertGroupBefore method to place a new group before currently selected group used as a reference group.

$(document).ready(function() {

// Create an instance of Accordion widget

var $bar = $('#accordion').accordion();


var getGroupCount = function(){

return $bar.accordion("getList").length + 1;



var createNewGroup = function(){

return { text: "Group" + getGroupCount() };



var getCurrentSelection = function(){

return $bar.accordion("option", "selectedGroup");



$bar.accordion("insertGroupBefore", createNewGroup(), getCurrentSelection());


<!DOCTYPE html>



<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>



<div id="accordion" class="widget"></div>





width: 300px;

height: 300px;



See Also