Hi,
I'm trying to implement Metronic indicator for page loading (https://preview.keenthemes.com/html/metronic/docs/base/page-loading).
I've copied sample code (js + html) from the mentioned page to my page.
On button click it reports next error in console:
Uncaught TypeError: KTApp.showPageLoading is not a function at HTMLButtonElement. <anonymous>.
I'm developing ASP.NET MVC application (not Core). Mandatory scripts for Metronic are loaded in <head> tag of _layout.cshtml.
What am I doing wrong?
Thanks for answer,
Best Regards, Valentin
Hi,
All clear, I'm using version 8.1.5. I haven't been able to update to 8.1.6 yet.
I'll update first and try again with page loading indicator later.
Thanks for you help and
Best Regards,
Valentin
You are most welcome. All the best with your project!
Hi,
May I know what is your Metronic version? The page loading API was added in the recent Metronic v8.1.6 version. If you are not using the latest one then please update it.
Are you using Metronic ASP.NET Core Starter Kit or integrating Metronic into your own ASP.NET application by using the HTML version assets and templates?\
How are you calling KTApp.showPageLoading ? In a click handler or on page load?
If you are calling it on page load you will need to execute your JS after all JS includes within the document ready event to make sure the code is executed once all JS resources are loaded:
// On document ready
KTUtil.onDOMContentLoaded(function() {
KTApp.showPageLoading();
});