Base solution for your next web application
Open Closed

Modal Width #765


User avatar
0
montanaprogrammer created

Is there a quick way to adjust the modal width for the modalManager? Didnt see any options for width in ModalManager.js, wondering if it could be accomplished easily via jQuery but the Modal_ + (Math.floor((Math.random() * .... + new Date().getTime(); seems a bit difficult to "key" off of...

Thoughts appreciated as always!


8 Answer(s)
  • User Avatar
    0
    montanaprogrammer created

    Just asking - I rubber duckied my way to the solution :)

    ModalManager - getModalId() and jQuery to modify the css.

    $thisModal = $('#' + _modalManager.getModalId()).find(".modal-content").css({ "width": "900px", "margin-left": "-10px" });

  • User Avatar
    0
    hikalkan created
    Support Team

    It seems fine. As alternative, you can provide modalId as option. It's generated randomly if you don't provide it (<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/Common/Scripts/ModalManager.js#L11">https://github.com/aspnetzero/aspnet-ze ... ger.js#L11</a>).

  • User Avatar
    0
    hasan created

    How to achieve the same thing in SPA Application ?

  • User Avatar
    0
    hikalkan created
    Support Team

    In SPA, we use standard $uiModal. You can see it's documentation: <a class="postlink" href="https://angular-ui.github.io/bootstrap/#/modal">https://angular-ui.github.io/bootstrap/#/modal</a> There is a size option there.

  • User Avatar
    0
    hasan created

    Dear Sir

    How to set the Modal Width for all the Modal in the application in SPA ?

    Thanks again.

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    I don't know if there is such a global configuration. You can check bootstrap and ui-bootstrap docs for it. We use size option for all modals.

  • User Avatar
    0
    hasan created

    Where to change the Size for all the modals ?

  • User Avatar
    0
    hikalkan created
    Support Team

    I could not understand the difference between previous question, sorry.