Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

How to add close button in SweetAlert pop up #5069


User avatar
0
OriAssurant created

We're using AngularJS+MVC5.*. Is there a way to modify the abp.sweet-alert.js to show close button on the pop-up modal?

For example: swal({ title: "Are you sure?", text: "Test message?", type: "info", showCancelButton: true, focusConfirm: false, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes", cancelButtonText: "No", showCloseButton: true }, function (isConfirm) {})

Thank you :ugeek: !


6 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    ASP.NET Zero uses (and ABP supports) SweetAlert v2, not SweetAlert2 that has the showCloseButton option.

  • User Avatar
    0
    OriAssurant created

    <cite>aaron: </cite> ABP (and ASP.NET Zero) uses SweetAlert v2, not SweetAlert2 that has the showCloseButton option.

    Thank you Aaron for the quick response. Hmm.. then it would be tough. is there a way to add the close button to the modal?

  • User Avatar
    0
    aaron created
    Support Team

    You might be able to hack the events and DOM in JavaScript.

    Related issue: https://github.com/t4t5/sweetalert/issues/479

  • User Avatar
    0
    aaron created
    Support Team

    I managed to hack together a solution: How to add close button in SweetAlert pop up

  • User Avatar
    0
    OriAssurant created

    This is awesome. Let me try it now! Thank you so much Aaron.

  • User Avatar
    0
    alper created
    Support Team

    thanks @aaron nice solution.