Filters
How Can I Filter the Calendar?
Filters operate like a constraining find request, letting you see just a subset of the events in the calendar.
Filters are available on the Filters tab in the left hand status area. The main filters are "Statuses" and "Resources" though you can call them something else and change their contents easily (more on status here and on resources here: resources).
Filtering by URL (Contact and Project Filters)
In addition to the built-in status and resource filters, you can filter the calendar by contact and project as well. This is done by adding filter values to DayBack's url in the browser.
Video and Example File Available
- You can download an example file with button code to help you get started here: Example File
For example, DayBack's url is normally:
But you can add parameters to filter the calendar. You can add parameters by hand of create buttons that will reset the url in your webviewer (if you're using WebDirect). Adding a filter to show only the project "My Project" would look like this:
Note that filters are set in name-value pairs where the name is "filtersProjects" (plural) and the value is "My%20Project" where the space between My and Project is replaced with %20.
When you send filters this way you'll see the filter criteria appear in DayBack's filter sidebar:
Once there, the filter can be turned off an on like any other filter and will persist until the user logs out or until the filter is cleared via url by sending "null" like this:
You can include more than one project in the filter like this:
This means that you can load a given session with just the logged in user's active projects, for example, and the they can toggle those on or off to get the specific view they need. Note that this currently won't restrict them from turning *all* their project filters off and then seeing all projects, so this url filtering isn't for security but rather to help users focus on just the events/projects/contacts they need to work with.
Filtering contacts works the same way, and as with projects you can send multiple contacts to the filter. You can also combine contact and project filters in the same URL. The syntax for filtering contacts is:
Note that you can also manipulate the always-visible status and resource filters using URLs, the syntax is filterStatuses=value and/or filterResources=value
Filtering by Source (Calendar)
Decide which source(s) are visible by including the source in your URL. This is helpful because the source you're interested in might currently be turned off.
Use...
...where "Events" is the name of your calendar in Admin Settings / Calendar Sources. If you just pass the name of one or more sources like this, DayBack will add the source to those currently turned on.
Note that the source parameter doesn't turn off any other calendars by default: it just makes sure that the one you specified is turned on. If you want to turn off all the calebdars except the one(s) you're filtering for, call null as your first source like this:
This is also the syntax for selecting multiple sources at once in the form
This null-first behavior works with all the filters which support multiple values.
Text filters
You can populate the text filter via URL by appending this to the end of the url
?filterText=Some%20Text%20I%20Like
To remove any set text filter use null
So a full url would look like:
Can I get a list of the active filters from the calendar?
Yes! Within a custom action, you can get a list of the filters using the function seedcodeCalendar.get(filterType)
Valid options for the filterType parameter are:
- statuses
- resources
- contacts
- projects
- textFilters
For example, to get a list of all the statuses: seedcodeCalendar.get('statuses')
This function returns an array of objects, containing all of those specific filters, whether active or not. Take a look at our custom action examples for an action that creates a link to your existing view, with filters applied, for DayBack users within your organization: Custom Function: Create a Link to Calendar View
What else can I do with URLs?
By including additional parameters in DayBack's URL you can also specify the focus date of the calendar or navigate to a particular view. Here are the parameters DayBack accepts:
agendaDay
basicWeek
agendaWeek
Month
basicResourceVert
agendaResourceVert
basicResourceHor (the Resource "Grid")
basicHorizon
You can also pull up a specific event in the calendar via url: you'd use this if you want to see a particular event in context. To do this, pass in the event's ID, Source, and the date of the event (optionally you can also include the view). DayBack will navigate to that date and bring up the event's popover just as if you'd clicked on it. If the calendar was in a filtered state so that the event wouldn't be visible, DayBack will clear those filters so you can see the event.
Here is an example of the URL syntax for viewing a particular event:
Note that neither "source", nor "id" actually filter the calendar: they're just used to tell DayBack which event you're interested in.