如何通过完整日历中的弹出框添加事件和事件描述 [英] How to add event and event description via popover in full calendar

查看:141
本文介绍了如何通过完整日历中的弹出框添加事件和事件描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用完整的日历来显示事件和假期.这些事件是从json文件生成的.如何在前端输入事件(即,如果用户单击特定的日期),则应显示一个空白的弹出框,以输入事件的标题和说明.如何实现呢?

I have used full calendar for displaying events and holidays. The events are generated from a json file. How to enter the events in the frontend (i.e) If the user click on a particular date , it should show a empty popover to enter the title and description of the event. How to achieve this ?

小提琴链接在评论中....

fiddle link is in the comment ....

推荐答案

如果我了解此说明是事件的内容,则可以更改此行:

If I understand the description is the content of the event, then you can change this line:

content: event.msg

content: event.title

阅读以下评论后进行

EDIT after reading the below comments:

我刚刚在您的window.load关闭中添加了这个关闭. 这在Firefox中有效,但在Chrome中只有一半功能(仅工作第一行代码). 在Firefox中,您可以跟踪用户通过其父级编辑的事件,并将其保存在日期和文本的关联数组中.

I just added this closure in your window.load closure. This is working in Firefox, but in Chrome is half-functional (works just the first line of code). In Firefox, you can track the edited events by the user through its parents and save it in an associative array of dates and text.

 $(document).on('dblclick', '.popover-title, .popover-content', function(){
         $(this).html(' ');
         $(this).attr('contentEditable',true);
    });

这篇关于如何通过完整日历中的弹出框添加事件和事件描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆