Is there a way to filter out event types in the calendar?

  • 1
  • Question
  • Updated 6 years ago
  • Answered
"Is there a way to filter out event types in the calendar? For example, say I only want to see Holidays in the calendar above. If there is no built in functionality, is there a way to extend the calendar control without having to re-create it?"

via Mike on help.skuidify.com
Photo of Anna Wiersema

Anna Wiersema

  • 10,890 Points 10k badge 2x thumb

Posted 6 years ago

  • 1
Photo of Anna Wiersema

Anna Wiersema

  • 10,890 Points 10k badge 2x thumb
Zach answers: "The ability to dynamically add/remove calendar event sources through a UI component is on the Skuid roadmap.

However, currently it is possible to build a custom component which would add/remove event sources by getting at the internal scal plugin that renders the calendar, like this:

1. Get a reference to the Calendar instance, after it has been initiated, through jQuery, e.g. var calendar = $j('#calendarDivId');
2. Get at the Calendar's internal object using jQuery data, e.g. var calObj = calendar.data('object');
3. Get the list of Event Sources from the internal object's settings: var eventSources = calObj.settings.eventSources;
4. Add/Remove eventSources from this list, e.g. using JavaScript's slice / splice, push/pop. Be sure to retain a reference to the event sources if you'd like to add them back in later!
5. To refresh the calendar view (after adding/removing event sources), call calendar.scal('refresh')

Before trying to do this, first get up to speed by taking the Building your own Skuid components tutorial (and the setting up your Module section). Especially the "Simple Map Component" tutorial (over at "http://skuidify.github.com/skuid/samplemap.html) will be helpful.

This should help get you oriented."

You can view the original conversation on the Skuid tutorial Adding Additional Event Sources to a Calendar on help.skuidify.com.