0

I'm using AdminLTE dashboard. In sidebar treeview menu active class remove after click on menu.

AdminLTE

  • Welcome to SO! Please review the following post and update the question appropriately: https://stackoverflow.com/help/how-to-ask – garfbradaz Jul 06 '17 at 13:49

1 Answers1

1

Add this javaScript in your footer

*this works for adminlte sidebar menu and also for sidebar menu treeview

    /** add active class and stay opened when selected */
var url = window.location;

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

// for treeview
$('ul.treeview-menu a').filter(function() {
    return this.href == url;
}).parentsUntil(".sidebar-menu > .treeview-menu").siblings().removeClass('active').end().addClass('active');
sssanjaya
  • 569
  • 6
  • 21