Closed mohamedmusthafac closed 9 years ago
Yes, I've noticed this as well. There is no onLoader that reads-in the hash value and sets the active class on the menu accordingly. Could you share your code bit? I'm about to do the same but am finding i can't do it as dyanmically as I want (I changed my loaders to be a mainprocess.php?DO=linkitem) style instead of html, but sometimes the title is Link Item, not Linkitem so matching it is of course difficult.
Yaaa here is my code
inside devoops.js Add this code
var ajax_url = location.hash.replace(/^#/, '');
if (ajax_url.length < 1) {
ajax_url = 'ajax/dashboard.html';
}
$('.main-menu li a[href$="' + ajax_url + '"]').ready(function() {
$('.main-menu li a[href$="' + ajax_url + '"]').addClass('active-parent active');
$('.dropdown:has(li:has(a.active)) > a').addClass('active-parent active');
$('.dropdown:has(li:has(a.active)) > ul').css("display", "block");
});
LoadAjaxContent(ajax_url);
$('.main-menu').on('click', 'a', function(e) {
$('.main-menu li a[href$="' + ajax_url + '"]').ready(function() {
$('.dropdown:has(li:has(a.active))').removeClass('active-parent active');
});
......... etc remaining coding continues
and this works fine for me
Thanks, this seems to work perfect :+1: )
You are welcome briansol, if there is any issue let me know it
Thank you for idea! Fixed in 359bff3818a74251a10e4c62118fecd771fc0d34
You are welcome deevoops
Hi,
var ajax_url = location.hash.replace(/^#/, ''); if (ajax_url.length < 1) { ajax_url = 'ajax/dashboard.html'; } i have used this ajax replace firefox working good, in chrome not working [ NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///D:/fastlane_erp/30-Aug/erp/ajax/charts_xcharts.html'.] this is my problem in google chrome please help me.
Hi. If I right understanding and remember - only FF can work with Ajax and local files. For Chrome and IE you need upload project to remove server.
Tq nnmware..
For Example: If i am in the page "Data Tables"
-Tables ----Data Tables
The left side menu gets active and it highlights the "Data Tables" Page But if i refresh the "Data Tables" page it should highlight the same "Data Tables" Page in left side menu after Refreshing, but it is highlighting the Dashboard Page
Any way i corrected this issue in my project by getting the current link in jquery and adding the active class in css using jquery for Left Side Menu