Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mladen Macanovic 22 posts 45 karma points
    Nov 26, 2010 @ 15:25
    Mladen Macanovic
    0

    Modal dialog

    I need to open custom aspx page as modal dialog. I'm using UmbClientMgr.openModalWindow to do this but when I try to click on the button that is calling this function it throws me an error saying:

    "Umbraco.Controls.ModalWindow is not a constructor." on line var m = new Umbraco.Controls.ModalWindow();  in UmbracoClientManager.js scipt file.

    If anyone know how to make this to work please help.

    I'm using umbraco 4.5.2.


  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Nov 26, 2010 @ 16:18
    Matt Brailsford
    0

    Hey Mladen,

    openModalWindow is just a static method, so you need to call it like so:

    UmbClientMgr.openModalWindow('/your/url/goes/here', 'Window Name', true, 500, 480);

    Matt

  • Mladen Macanovic 22 posts 45 karma points
    Nov 26, 2010 @ 16:36
    Mladen Macanovic
    0

    I call it like this

    myBtn.Attributes.Add( "onclick", "UmbClientMgr.openModalWindow('mypage.aspx', 'some title', true, 800, 600);" );

    Is this the right way to do it?

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Nov 26, 2010 @ 16:41
    Matt Brailsford
    0

    Hmmm, that should be fine.

    Is your button housed in an Umbraco ensured page? Maybe some JS file has not been included on the page?

    Matt

  • Mladen Macanovic 22 posts 45 karma points
    Nov 26, 2010 @ 16:46
    Mladen Macanovic
    0

    Well this are the js files that are included in the page

    <script type="text/javascript" src="umbraco_client/Application/NamespaceManager.js">script>
    <script type="text/javascript" src="umbraco_client/Application/UmbracoApplicationActions.js">script>
    <script type="text/javascript" src="umbraco_client/Application/UmbracoUtils.js">script>
    <script type="text/javascript" src="umbraco_client/Application/HistoryManager.js">script>
    <script type="text/javascript" src="umbraco_client/Application/UmbracoClientManager.js">script>
  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Nov 26, 2010 @ 16:55
    Matt Brailsford
    0

    Hmmm, have you tried adding a reference to the modal.js ?

    \umbraco_client\modal\modal.js

    Or maybe, if you are in an iframe, try and reference the "top" variable to use it as defined in the umbraco surround?

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft