adgsm / multi-level-push-menu

MultiLevelPushMenu jQuery Plugin implementation
http://multi-level-push-menu.dzunic.net
804 stars 213 forks source link

Full Path #163

Closed AbhinavWase closed 7 years ago

AbhinavWase commented 7 years ago

Hi, Please help me in getting full path (path from root to item clicked) of clicked menu node.

adgsm commented 7 years ago

Please check documentation. `` /**

AbhinavWase commented 7 years ago

I've gone through documentation, but no luck. Please let me brief my requirement I'm using MultiLevelPushMenu, onwhich I'm using bootstrap context menu where I need to have option for creating folders, pages and edit options like copy edit and paste.

any example of return path will be highly appreciated.

Thanks,

adgsm commented 7 years ago

Please check my previous answer. I have pasted in there from documentation an method which will provide you path from curently expanded menu to the root. Here it is once again below.

$('#menu').multilevelpushmenu('pathtoroot', $menuLevelObject);
AbhinavWase commented 7 years ago

sorry to ask this again, I'm getting object as alert but not able to dig down into same, attached the screenshot of what I'm getting. I'm new to Jquery, could you please help me in getting path into string format from this object...

Thanks again...

here's my code

$(document).ready(function(){ // HTML markup implementation, overlap mode $( '#menu' ).multilevelpushmenu({ containersToPush: [$( '#pushobj' )], menuWidth: '25%', menuHeight: '100%', onItemClick: function() { // First argument is original event object var event = arguments[0], // Second argument is menu level object containing clicked item (

element) $menuLevelHolder = arguments[1], // Third argument is clicked item (
  • element) $item = arguments[2], // Fourth argument is instance settings/options object options = arguments[3];

        // You can do some cool stuff here before
        // redirecting to href location
        // like logging the event or even
        // adding some parameters to href, etc...
        var path = $('#menu').multilevelpushmenu('pathtoroot', $item);
    
        alert(path);
    }
    });

    }); cap