Note that there are some explanatory texts on larger screens.

plurals
  1. POneed help for fullcalendar jquery
    text
    copied!<p>I'm trying to add this fullcalendar to my yii app. and because of this is my first time, I've already try to learn the tutorial from <a href="http://arshaw.com/fullcalendar/docs" rel="nofollow">http://arshaw.com/fullcalendar/docs</a> . but it's quietly hard for me to understand because I'm weak in JQuery, JSON and others. so anyone can help me, step by step, what I need to do to add events from my database?</p> <p>this is my json-events.php:</p> <pre><code>&lt;?php $query = Yii::app()-&gt;db-&gt;createCommand('SELECT TASKID, STARTTIME, ENDTIME FROM task'); $result = $query-&gt;queryAll(); foreach ($result as $row) { $data[] = array( 'id' =&gt; $row['TASKID'], 'start' =&gt; $row['STARTTIME'], 'end' =&gt; $row['ENDTIME'], 'allDay' =&gt; false, 'editable' =&gt; true, ); } echo json_encode($data); </code></pre> <p>is this correct or not? and in where directory should I put this php? </p> <p>and this is my calendar.js:</p> <blockquote> <p>jQuery('#calendar').fullCalendar({ eventSources: [</p> <pre><code> // your event source { url: '/path/todirectory/protected/views/task/json-events.php', backgroundColor: '#3D8BFF', textColor: '#7AE4FF' } ], header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, editable: true, droppable: true, drop: function(date, allDay) { var originalEventObject = jQuery(this).data('eventObject'); var copiedEventObject = jQuery.extend({}, originalEventObject); copiedEventObject.start = date; copiedEventObject.allDay = allDay; jQuery('#calendar').fullCalendar('renderEvent', copiedEventObject, true); jQuery(this).remove(); } }); </code></pre> </blockquote> <p>another things to ask, when I tried to add events with array, it works. but it's not draggable. how to make it draggable?</p> <p>Please help me. thanks in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload