Modal Form reusable.

14 views
Skip to first unread message

Julio Parra-Sanchez

unread,
Jun 28, 2019, 1:05:34 PM6/28/19
to django...@googlegroups.com
Buenos Dias Amigos,

Alguno de ustedes ha utilizado los modal de bootstrap y reutilizarlo como template, pasandole como variable el modal que van a renderizar?

Gracias y espero me haya explicado bien.
------------------------------------------------------
Hello Guys,
Have any of you used bootstrap's manners and reused it as a template, passing as a variable the modal to render it?
thanks

--

    name     : "Julio Parra Sanchez", 
    title    : "Apprentice Developer", 
    company  : "Techtonic", 
    location : "Denver, CO" 
}

Volodymyr Sergeyev

unread,
Jul 1, 2019, 3:04:40 AM7/1/19
to Django users
Buenos Dias,

May be this will help.

Modal has an event, fired when it is about to show https://getbootstrap.com/docs/4.0/components/modal/#events
Event - 'show.bs.modal'

So you may bind handler to it and render modal with fields you wish:

$('#dynamic_modal').on('show.bs.modal', function (e) {
    
$('#dynamic_modal').find(".modal-body").html(YOUR_NEW_CONTENT);
});

Regards,

V.
Reply all
Reply to author
Forward
0 new messages