Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • 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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(