Get 2025 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Metronic 9 - Livewire menus not working


Hi,

I had tried to use Metronic 9 via Livewire but menus (sidebar and profile menu, top right) are not opening. I use currently livewire with Metronic 8 and menus are opening help of below script:

document.addEventListener("livewire:navigated", () => {
KTComponents.init()
KTMenu.init();
});


But this script not working with Metronic 9. Please, can you help me?


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (7)


Hi

Sorry for the delay. Could you please try this code?


document.addEventListener("livewire:navigated", () => {
KTMenu.init = function () {
KTMenu.createInstances();
KTMenu.initHandlers();
};
KTMenu.init();
});



it is not working also. I add console.log, it printed but menus are not working



Hi,

Can you please share a test link via private reply?
Otherwise please provide more info, do you get any error in your console? Please try to put console.log('some log') debug messages in your code and detect where the code broke.

Regards.



is there another solution?



Hi,

Could you please try to use livewire:load?

Thank you



Any other suggestions? I am facing the same issue and don't have a clue how to get menus running after using a livewire:navigate link



it's not working also


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(