Q:

Make the  to be Active when click submenu

Currently i'm using AdminLTE template for my dashboard, but for the second drop down after i click the the second menu, that menu is not stay but it's closing.
When Cascade

After Click

Below is my html code. I'm using codeigniter so i use this anchor for .
 <?php if($this->session->userdata('usergroup') == '1' or $this->session->userdata('usergroup') ==  '4') { ?>
    <li class="treeview">
      <a href="#"><i class="fa fa-link"></i> <span>Ticketing</span> <i class="fa fa-angle-left pull-right"></i></a>
      <ul class="treeview-menu">
        <li><?php echo anchor('Bticketing/Ballticket',"<i class='fa fa-circle-o'></i> All Ticket") ?></li>
         <li><?php echo anchor('Bticketingcalendar',"<i class='fa fa-circle-o'></i> Calendar") ?></li>
      </ul>
    </li>
    <?php } ?>

What i want is after i click the all ticket, that menu is stay and show the page. how to do that ?
Note : the default one for active is <li class="treeview active"> but how to make it dynamic to all menu.

A:

Here is code if you want to create active state on AdminLTE menu
var url = window.location;

// for sidebar menu entirely but not cover treeview
$('ul.sidebar-menu a').filter(function() {
  return this.href == url;
}).parent().addClass('active');

// for treeview
$('ul.treeview-menu a').filter(function() {
  return this.href == url;
}).closest('.treeview').addClass('active');

Hope it will help

