Bootstrap dynamicModal Plugin
dynamicModal is a plugin that dynamically generates the modals with Bootstrap. If you have a web project that demands many modals you do not have to write a HTML code for each modal. You simply have to generate the modals with the Bootstrap dynamicModal plugin.
This plugin has a special feature, namely the Boootstrap DateTimePicker plugin. This you can load into a modal and transfer the requested date or/and the requested time to an input field.
Requirements
Bootstrap v3.+
jQuery
Bootstrap DateTime Picker v2
Optionen
ID | Modal ID |
CLS | Modal Class |
Title | Modal Title |
Content | The content that should be placed in the modal |
Buttons | An object, that contains a list of button’s parameters, f.e { text:'Do something', // Button-Text id:'doSomthing', // Button-ID cls:'btn-primary' // Button-Class } |
DateTimePicker | An object, that defines the parameters of the „Bootstrap DateTimePicker“ Here you can learn more about the funktions of this plugin:: www.malot.fr/bootstrap-datetimepicker/ |
Usage
<button class="btn btn-primary" data-toggle="modal" data-target="#mymodal">Click to open Modal</button>
<script>
$('body').dynamicModal({
id:'mymodal',
cls:mymodal',
title:'My modal',
content:'<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumyeirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua</p>.',
buttons:[{
cancel:true,
text:'Cancel',
id:'cancel',
cls:'btn-default'
},
{
text:'Do something',
id:'doSomthing',
cls:'btn-primary'
}]
})
</script>