Close

Location to inject Jquery code AFTER page loads and all Panels have finished loading, also on Panel refresh

rgarcia350
2 years ago
#13429 Quote
Avatar
  • 2
I need to know where in the code - Razor form or .js function I can iject jquery code to change the DOM (such as attaching a datepicker to a Checkout attribute text field.  I need it to be a place that work during the initial page load and also after any one of the panels get updated or refresh.  I have implemented some code using timeouts in the Document ready event, but it only works sometimes.
SDobrev
2 years ago
#13431 Quote
Avatar
  • Moderator
  • 272
Hello,

We are broadcasting events to refresh the panels

You can use the ExternalController located in Plugins\SevenSpikes.Nop.Plugins.RealOnePageCheckout\Scripts\app\external\external.controller.min.js

To listen for an event use this code inside the ExternalController function:

    $rootScope.$on("refresh", function (event, data) {
        if (data.controller != undefined && data.controller == "BillingAddressController") {
            // Refresh only billing address controller
        }

        // Refresh
    });


In the data.controller you can find which panel would be refreshed.
Best Regards,
Stoyan Dobrev
Nop-Templates.com