I am currently utilizing the AdminLTE template on my website. One issue I have encountered is with the menu and its child menus. When redirecting to different pages using image buttons, the menu collapses back to its original state.
While navigating through the menu alone works fine, clicking on an image button within a web form of a menu item causes the menu to lose its active state.
https://i.stack.imgur.com/77xE5.jpg
In the top right corner, there are options for Adding, Editing, and Deleting pages. My goal is to keep the Hardware Menu active until redirected to another menu.
I have tried using the following Javascript code for the Menu, which works for Menu items:
var url = window.location;
$('ul.sidebar-menu a').filter(function () {
return this.href != url;
}).parent().removeClass('active');
$('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;
}).parentsUntil(".sidebar-menu > .treeview-menu").addClass('active');