title: Filtering Fullcalendar events based on additional ID parameter
body: <p>I am using the jQuery library <a href="http://arshaw.com/fullcalendar/" rel="nofollow">Fullcalendar</a> to display events for sports teams from a MYSQL database. I have managed to properly setup a JSON feed which displays all the events in the database. </p>
  
  <p>However, a coach can administrate up to three teams, and each of these teams have their own page with its own calendar. Currently, all events are listed in all calendars. I need some sort of filter to make sure that only events belonging to the right team is displayed in each calendar. </p>
  
  <p>I have given each team a unique URL based on their ID, like this.</p>
  
  <pre><code>http://localhost/master/index.php/team/56
  </code></pre>
  
  <p>The JSON feed currently outputs this:</p>
  
  <pre><code>{"id":"14","event_id":"8","team":"56","start":"2013-12-16 18:00:00","title":"Mandagsgym","description":"Ivar er trenar","location":"Haukelandshallen","start_time":"18:00:00","end_time":"20:00:00"}
  </code></pre>
  
  <p>My current jQuery: </p>
  
  <pre><code>var filter_id = $('#filter_id').val(); //a variable with the team ID, 
                                         fetched from a hidden input field
  
  $('#calendar').fullCalendar({
      firstDay:'1',
      defaultView: 'basicWeek',
      height: 400,
      editable: true,
      weekends: false,
      header: 
      {
          left: '',
          center: '',
          right: 'prev,next, month,basicWeek'
      },
      columnFormat: 'ddd d/M',
      allDayDefault: false,
      events: 
      {
          url: 'http://localhost/master/index.php/team/json'
      }
      });
  </code></pre>
  
  <p>As I see it, I have two options: 
  1) Find a way to assign the third segment of the URL (the team ID) to the JSON feed PHP function, hence providing the calendars with dynamic JSON feeds.</p>
  
  <p>2) Fetch the team ID from the URL, assign it to a Javascript variable and then do some filtering using the Fullcalendar methods, removing or at least hiding the events from the calendar where the team ID does not match the team ID in the URL. </p>
  
  <p>Both of these proposed approaches are well beyond my relatively limited knowledge. I personally fancy approach nr.2. I would be absolutely delighted if anyone could come up with a solution, as I've been stuck on this problem for days.</p>