Topic: Dismissible alerts

Camden pro asked 16 hours ago


The alert component is a paid component, but does that apply to all aspects of alerts? I'm still able to show alerts without a paid subscription, so I assume the base bootstrap functionality still works.

I'm asking because I'm having difficulty getting dismissible alerts to work, so I want to make sure it's not because I need to pay for it.

Thanks


Bartosz Cylwik staff answered 5 hours ago


Hi, you are right, some basic bootstrap functionalities do work without the paid version. Unfortunately most of the functionalities you can see in our docs for alert (dismissible alerts included) would require to use the pro version.

From what I can see though, the method close is available in free version so you can create a dismiss button yourself.

Don't add the data-mdb-dismiss attribute to the button and call the close method. Something like this should work

  const instance = mdb.Alert.getInstance(document.getElementById("alert"));

  document.getElementById("dismiss").addEventListener("click", () => {
    instance.close();
  });

Best Regards!



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 9.3.0
  • Device: Laptop
  • Browser: Chrome
  • OS: Mac
  • Provided sample code: No
  • Provided link: Yes
Tags