Fullcalendar:事件未正确呈现

时间:2016-05-31 08:27:27

标签: ajax javascript-events fullcalendar

嗨同行,

我的代码无法正确呈现。以前,我让它正常工作,但现在它还没有活着。我不知道怎么。请告诉我哪里出错了。

HTML模式模态代码。              

<div class="form-group">
  <input type="text" name="calendar_eventsubject" value="" id="calendar_eventsubject" placeholder="calendar_eventsubject" data-validation-required-message="Enter the calendar_eventsubject" class="form-control" required="">
  </div>
  <div class="form-group">
  <textarea name="calendar_eventbody" cols="40" rows="3" id="calendar_eventbody" placeholder="calendar_eventbody" data-validation-required-message="Enter the calendar_eventbody" class="form-control" required=""></textarea>
       </div>
      <div class="row">
      <div class="control-label col-sm-3">
    <label for="start_date">Start Date</label>
    </div>
    <div class="col-sm-7">
    <input type="text" class="form-control" id="event_start_date" placeholder="Start Date">
    </div>

  </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              <button type="button" class="btn btn-primary" id="save_event">Save changes</button>
       </div>

以上是显示模态表单的代码,可用于添加事件。 以下是脚本:

 <script>
$(document).ready(function() {

$('#calendar').fullCalendar({ 
  customButtons: {
    EventButton: {
        text:'Add Event',
        click:function(event, jsEvent, view){
                   $('#modal_calendar').modal('show');
          }
    }
  },
utc: true, 
header: { 
left: 'prev,next today EventButton', 
center: 'title', 
right: 'month,agendaWeek,agendaDay' 
},   

editable: true, 
droppable: true, 

eventSources: ["calendar/show_events", "calendar/show_holidays"],
eventAfterRender: function(event, element, view) { 
element.append(event.title); 
} 
});

$('#event_start_date').datepicker();
$('#save_event').click(function() {
    $.ajax({
              cache: false,
              type: "POST",
              url:"<?php echo base_url() ?>common/calendar/save_event",
              data :  {'subject' : subject,'body' : body,'start_date' : start_date},
              dataType: 'json',
              success: function(result){
                if (result!=null){
                    }
                    }
                    });
});
        });
</script>
<style>
.event-full { 
color: #fff; 
 vertical-align: middle !important;
text-align: center; 
opacity: 1; 
}
.datepicker
{
    z-index:1151 !important;}

</style>

现在事件未正确呈现。前一代码中的错误是什么。我哪里错了?对不起,长码,谢谢你!

0 个答案:

没有答案