philippfrenzel / yii2fullcalendar

JQuery Fullcalendar Yii2 Extension
GNU General Public License v2.0
132 stars 95 forks source link

editable not working #79

Open djnordeen opened 7 years ago

djnordeen commented 7 years ago

Hello Phillip, I have loaded the calendar from a database. The mouse changes to a hand when hovering over an event, however it does not move. I have been searching for an answer, trying different things but have not succeeded. Do you have any ideas on where I should check.

View

`yii2fullcalendar\yii2fullcalendar::widget(array( 'events' => $events, 'id' => 'calendar', 'clientOptions' =>[ 'allDaySlot' => false, 'eventLongPressDelay' => 1500, 'selectLongPressDelay' => true, 'hiddenDays'=> [0], 'height' => 'auto', 'minTime' => '08:00:00', 'maxTime' => '20:00:00', 'selectable' => true, 'selectHelper' => true, 'droppable' => true, 'editable' => true, 'drop' => new JsExpression($JSDropEvent), 'select' => new JsExpression($JSCode), 'eventClick' => new JsExpression($JSEventClick), ], )); js $DragJS = <<<EOF / initialize the external events -----------------------------------------------------------------/ $('#calendar .fc-draggable').each(function() { // store data so the calendar knows to render an event upon drop $(this).data('calEvent', { title: $.trim($(this).text()), // use the element's text as the event title stick: true // maintain when user navigates (see docs on the renderEvent method) }); // make the event draggable using jQuery UI $(this).draggable({ zIndex: 999, revert: true, // will cause the event to go back to its revertDuration: 0 // original position after the drag }); }); EOF;

$JSCode = <<<EOF function(start, end) { var title = prompt('Event Title:'); var eventData; if (title) { eventData = { title: title, start: start, end: end }; $('#w0').fullCalendar('renderEvent', eventData, true); } $('#w0').fullCalendar('unselect'); } EOF;

$JSDropEvent = <<<EOF function(date) { alert("Dropped on " + date.format()); if ($('#drop-remove').is(':checked')) { // if so, remove the element from the "Draggable Events" list $(this).remove(); } } EOF;

$JSEventClick = <<<EOF function(calEvent, jsEvent, view) { alert(calEvent.title + ' -- ' + calEvent.description); } EOF; `

philippfrenzel commented 7 years ago

did you enable drag n drop ? looks like you forgotten to enable an option;)

djnordeen commented 7 years ago

Hello Phillip, I am not sure what options you are talking about.

I thought the following made them editable. editable => true selectable => true selectHelper => true droppable => true

Could you elaborate more on what I need to enable?

Thanks, Dan

djnordeen commented 7 years ago

Hello Phillip,

Have not heard from you in a while. Could you elaborate more on what I need to enable?

philippfrenzel commented 7 years ago

Hi, sorry beeing busy - I'll check an come back with an answer tomorrow!

djnordeen commented 7 years ago

Hey Phillip, I know you have been busy. But I really could use the help.