Announcement

Collapse
No announcement yet.

LoadFinishedHandler?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    LoadFinishedHandler?

    Hi folks --

    In Miva 5, a module could define a JavaScript function called LoadFinishedHandler() on an admin page, and the function would get called once the page finished loading. In Miva 9, this functionality is gone, or maybe the name has been changed? Can someone clarify how this works in v9?

    Thanks --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    #2
    Re: LoadFinishedHandler?

    Hey Kent,

    LoadFinishedHandler should be working the same as it did pre-MM9. Is your LoadFinishedHandler being overridden later on in the code by something else? If your module/code is going to be MM9+ specific, you can use the following to add your code to a load finished queue (so that later functions cannot override your code):

    Code:
    MMScreen_LoadFinished( function() { /* Your Code Here */ } );
    Ryan Guisewite
    Lead UI Developer / Miva, Inc.
    www.miva.com

    Comment


      #3
      Re: LoadFinishedHandler?

      I've done some more tests, and added an alert() to my LoadFinished code, to help with debugging. The alert message never shows up, so it seems clear that my handler isn't being executed. Per your suggestion, I also tried this:
      Code:
      		MMScreen_LoadFinished( function() { 
      			alert('Ready to resume.');
      			QFDimport('prod');
      		 } );
      Again, the alert message was never displayed.

      Does it matter where I put the JavaScript? It's currently near the bottom of the page.

      I should mention that this us a utility module, and I'm working on the "_Screen" page, not the "_Content."

      Any other ideas?

      Thanks --
      Last edited by Kent Multer; 04-20-15, 11:48 PM.
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment


        #4
        Re: LoadFinishedHandler?

        Follow-up: I was able to get this working; just a minor bug in my own code. The last thing I need to fix has to do with the scrolling position of the page. I've noticed that admin.mv now automatically scrolls the page after you click an Update button. This is usually helpful, since it returns you to the same place you were before on a long admin page. But in this case, I want the page to scroll to a specific position; is there a way to do that?

        Thanks again --
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment

        Working...
        X