Francis Saul
Francis Saul

Reputation: 750

event from modal textbox values not rendering : fullcalendar

I'm using jquery fullcalendar and created a modal where the user will enter specific start and end time.

Below is my initialization of fullcalendar

    //for datePicker Only under modal

    $('#startDate').datepicker();
    $('#startTime').timepicker();
    $('#endTime').timepicker();


    var theCalendar = $('#calendar');

    $(theCalendar).fullCalendar({


        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        timeFormat: 'h:mm',
        defaultView: 'month',
        editable: true,
        selectable: true,

        select: function(start, end, allDay) {

             $("#myModal").modal("show");     
        },

    });

Upon clicking the save button, there is no event rendered in the calendar.

enter image description here

Below is the code of save button

  function saveBtnSchedule() {
    //get values entered by the user
    startt = $('#startTime').val();
    endd = $('#endTime').val();


    $("#calendar").fullCalendar('renderEvent',
    {

        title: $('#CustomerFullName :selected').text(),
        start: startt,
        end: endd,
        allDay: true

    },
        true); 

    $(theCalendar).fullCalendar("renderEvent", event, true);

}

I am using datepicker,timepicker and fullcalendar.

Upvotes: 0

Views: 422

Answers (1)

LakiGeri
LakiGeri

Reputation: 2105

try this:

var eventsArray = new Array();
eventsArray.push(event);
$(theCalendar).fullCalendar("addEventSource", eventsArray);

The renderEvent didnt work for me either. I know it is not the prettiest solution..

Upvotes: 1

Related Questions