FullCalendar开放式Bootstrap模态当日点击 [英] FullCalendar open bootstrap modal on dayClick
本文介绍了FullCalendar开放式Bootstrap模态当日点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当用户单击fullCalendar中的某天时,我想打开一个引导模式.我查看了dayClick事件,但无法弄清楚该模型的调用方式.
I want to open a bootstrap modal when users click on a day in fullCalendar. I have look over dayClick event but can't figure out how to call the model.
dayClick: function(date, jsEvent, view) {
// call the model
},
调用引导程序模型的普通链接
Normal link to call a bootstrap model
<a href="#" data-toggle="modal" data-target="#myModal"..................../>
我仅使用1个引导程序模型来满足我的所有需求,并且只需更改内容即可.我这样做的方法是调用href ..所以我的链接看起来像:
I use only 1 bootstrap model for all my needs and simply change the content. The way I do this is by calling a href .. so my link looks like :
<a href="<?php echo site_url('model/add') ?>" data-toggle="modal" data-target="#myModal" role="button" class="btn-u btn-block"> Add</a>
推荐答案
如果其他人需要在引导程序模型中打开fullCalendar事件,我找到了解决方法:
If someone else needs to open fullCalendar events in bootstrap model I found the way to do it :
添加:
eventClick: function(event, jsEvent, view) {
$('#modalTitle').html(event.title);
$('#modalBody').html(event.description);
$('#eventUrl').attr('href',event.url);
$('#calendarModal').modal();
},
和模型:
<div id="calendarModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span> <span class="sr-only">close</span></button>
<h4 id="modalTitle" class="modal-title"></h4>
</div>
<div id="modalBody" class="modal-body"> </div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
这篇关于FullCalendar开放式Bootstrap模态当日点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文