Open Closed

How to close modals when click button Exit #3391


User avatar
0
thaithiendi created

Dear support Team,

I have a button on Modal, when click i want to close Model, but i don't know how to call "Modal.close()"

  • ABP Framework version: v4.4.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    var myModal = new abp.ModalManager({
        //...options
    });
    
    //Open the modal
    myModal.open();
    
    //Close the modal
    myModal.close();
    
    

    https://docs.abp.io/en/abp/latest/UI/AspNetCore/Modals

  • User Avatar
    0
    thaithiendi created

    Sorry maliming,

    But i mean i want to code button Exit like button Cancel. I'm coding on abp-modal. <abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> <abp-button id="btnExit" text="@L["Exit"].Value" button-type="Primary" />

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try to add close class to the button

    class="close" data-dismiss="modal" aria-label="Close"

  • User Avatar
    0
    thaithiendi created

    Thanks maliming, That code is what i need.

    One more question: How i can refesh content of Modal when I click a button on that Modal. Because When I click the button, something will change the value in database. And I want to refesh content Modal to update for user.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You can bind an event callback for this button and get the latest data from the backend, then update the values.

  • User Avatar
    0
    thaithiendi created

    Thanks maliming.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11