Showing posts with label bootstrap. Show all posts
Showing posts with label bootstrap. Show all posts

Friday, July 28, 2023

Bootstrap 5 Multiple Modal Overlay | How to use multiple modal in bootstrap?

Let me explain my problem, I am using bootstrap modal for my project. That is fine but I get stucked when another modal open over first modal. To solve this problem I added below javascript code to my project and it get solved.
$(document).on('show.bs.modal', '.modal', function() {
    const zIndex = 1040 + 10 * $('.modal:visible').length;
    $(this).css('z-index', zIndex);
    setTimeout(() => $('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack'));
});
Now my modals are looking like below:

Tuesday, September 17, 2013

Access Grails Application in BootStrap

Accessing the Grails application object in BootStrap.groovy is easy. 
We only have to define a variable named grailsApplication and Spring's 
name based injection takes care of everything.
 
class BootStrap {
    // Reference to Grails application.
    def grailsApplication

    def init = { servletContext ->
        // Access Grails application properties.
        grailsApplication.serviceClasses.each {
            println it 
        } 
    }

    def destroy = {}
}