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

Menus don't work on dynamic pages - Angular


Dear Support Team,

I'm struggling to make the menus work when I press the button. We have aspnetzero 11.3 with Angular and Metronic 8.

I got to the point that menus work when the page is initially loaded however if I have a button with a menu attached on the cards which dynamically load (lazy load), buttons do not trigger the menus.


<div class="card-footer text-end">
<div class="d-flex flex-stack">
<div>
<button id="testbtn" type="button" class="btn btn-sm btn-primary" data-kt-menu-trigger="click" data-kt-menu-placement="bottom-start" data-kt-menu-attach="#testbtn" data-kt-menu-overflow="true">Click
</button>
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg-light-primary fw-semibold w-200px" data-kt-menu="true">
<div class="menu-item px-3">
<div class="menu-content fs-6 text-dark fw-bold px-3 py-4">Quick Actions</div>
</div>
<div class="separator mb-3 opacity-75"></div>
<div class="menu-item px-3">
<a href="#%22%20class=%22menu-link%20px-3" target="_blank" rel="noopener noreferrer">New Ticket</a>
</div>
<div class="menu-item px-3">
<a href="#%22%20class=%22menu-link%20px-3" target="_blank" rel="noopener noreferrer">New Customer</a>
</div>
</div>
</div>
</div>
</div>


I tried with overflow true/false, attachment to parent and by id, no joy.

Any advise would be appreciated.

Kind Regards, Matt


Text formatting options
Submit

Replies (2)


Thank you Carmelo, we will try that!

Kind Regards, Matt



Hi.

In the file src/app/_metronic/kt/kt-helpers.ts you have menuReinitialization method, which need to be called after component HTML is injected into the DOM.

Regards,
Keenthemes support


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.
Text formatting options
Submit
Text formatting options
Submit