Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3599286
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:20:56+00:00 2026-05-18T20:20:56+00:00

I’m trying to use FullCalendar to display my events from a JSON feed. It’s

  • 0

I’m trying to use FullCalendar to display my events from a JSON feed. It’s working fine with the following code:

$(document).ready(function() {

// Initialize calendar
$('#calendar').fullCalendar({   
    header: {
        left: 'prev',
        center: 'title',
        right: 'next'
    },
    buttonText: {
        prev: 'Previous month',
        next: 'Next month'
    },
    columnFormat: {
        month: 'dddd'
    },
    editable: false,
    events: "events.json",
    disableDragging: true,                      
});

I’m trying to create a link that’ll filter the events (ideally, it would be a select menu) using the removeEvents method. When I use the method and pass in an ID, the event gets removed. The documentation states:

idOrFilter may also be a filter function that accepts one Event Object argument and returns true if it should be removed.

I read that the filter function should operate just like jQuery’s grep method, but I don’t understand how to implement it. I started writing the below, but I’m uncertain how to continue. Any suggestions or examples would be greatly appreciated!

...

$('#filter').click(function() {
     $('#calendar').fullCalendar ( 'removeEvents', filter(events) );
}

...

function filter (events) {
...
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:20:57+00:00Added an answer on May 18, 2026 at 8:20 pm

    If you’re using a select to accomplish this, you’ll need some way of associating the options in the select and the events in the calendar. I’ve made the options have ids that match those of the events in the calendar:

    JavaScript (using the events property of fullCalendar):

    events: [
        {
            id: 'event-1',
            title: 'Christmas Eve',
            start: '2010-12-24',
            allDay: true
        },
        {
            id: 'event-2',
            title: 'Christmas Day',
            start: '2010-12-25',
            allDay: true
        },
        {
            id: 'event-3',
            title: 'Boxing Day',
            start: '2010-12-26',
            allDay: true
        }
    ] 
    

    Your source of events does not have to be an array, this is just for the example I created.

    HTML:

    <select id="filter">
        <option id="event-1">Christmas Eve</option>
        <option id="event-2">Christmas Day</option>        
        <option id="event-3">Boxing Day</option>        
    </select>
    

    Now, the removeEvent function, as you described, takes one event object and returns a boolean value indicating whether or not the event should be removed:

    function filter(event) {
        return $("#filter > option:selected").attr("id") === event.id;
    }
    

    What the filter function does is return true if the option selected under the select with id filter has an id that matches the id of the event that is passed to it. This function can really be anything, as long as it returns true or false.

    The way it works under the hood is that when you call removeEvent and pass your function, each of the events living on the calendar gets passed to that function and if true is returned, the event is removed.

    I’ve made a working example (http://jsfiddle.net/andrewwhitaker/QMyFu/) that also includes another example of a filter function and select element.

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.