title: Ajax response full calendar view page issue
body: <p>Here is the relevant code:</p>
  
  <p>VIEW PAGE:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
          $(document).on("click", ".calendarview", function () {  
  
          var roomid = $(this).data('id');
          //alert(roomid);exit;
  
           $('#calendar_view').fullCalendar({
              //events: [
      //          {
      //                  title: 'All Day Event',
      //                  start: roomid
      //              }
      //                  ]
              events: {
              url: base_url+'home/calview',
                  dataType: 'json',
                 data: {roomid: roomid},
                 type: 'POST', // Send post data
                 error: function() {
                   alert('There was an error while fetching events.');
                 }
              }
           });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>IN CONTROLLER</p>
  
  <pre><code>function calview()
         {
                      $room_id =$this-&gt;input-&gt;post('roomid');
                      $events=$this-&gt;Home_model-&gt;find_room_availability($room_id); 
                          $data_events = array();
                          foreach($events as $r) {
                      $data_events[] = array(
              //"title" =&gt; $r-&gt;available,
                      "description" =&gt; 'available',
                      "start" =&gt; $r-&gt;dt);
                          }
                  echo json_encode(array("events" =&gt; $data_events));
                  exit();
          }
  </code></pre>
  
  <p>MODEL:</p>
  
  <pre><code>function find_room_availability($room_id){
      $result = $this-&gt;db-&gt;query("SELECT x.dt , r.room_cnt - COALESCE(SUM(`booking_cnt`),0) available FROM calendar_table x LEFT JOIN bookinglist y ON x.dt &gt;= y.`date_from` AND x.dt &lt; y.`date_to` LEFT JOIN rooms r ON r.id=$room_id WHERE x.dt BETWEEN now() - interval 3 month AND now() + interval 5 month GROUP BY dt ");                                           
      //echo $this-&gt;db-&gt;last_query();
      //exit;
    return $result-&gt;result();     
  
  }
  </code></pre>
  
  <p>Ajax response is like</p>
  
  <pre><code>[[{"title":"10","start":"2017-04-26"},{"title":"10","start":"2017-04-27"},
  {"title":"10","start":"2017-04-28"},{"title":"10","start":"2017-04-29"},
  {"title":"10","start":"2017-04-30"},{"title":"10","start":"2017-05-01"},
  {"title":"10","start":"2017-05-02"},{"title":"10","start":"2017-05-03"},
  {"title":"10","start":"2017-05-04"},{"title":"10","start":"2017-05-05"},
  {"title":"10","start":"2017-05-06"},{"title":"10","start":"2017-05-07"},
  {"title":"10","start":"2017-05-08"},{"title":"10","start":"2017-05-09"},
  {"title":"10","start":"2017-05-10"},{"title":"10","start":"2017-05-11"},
  {"title":"10","start":"2017-05-12"},{"title":"10","start":"2017-05-13"},
  {"title":"10","start":"2017-05-14"},{"title":"10","start":"2017-05-15"},
  {"title":"10","start":"2017-05-16"},{"title":"10","start":"2017-05-17"},}]]
  </code></pre>
  
  <p>can anyone please help me to find a solution</p>