arshaw/fullcalendar — pull request #70 by stephenh1988 (2012-10-31 16:28:13+00:00)
Title: Add ability to define custom header element via callback

Hi Adam,

Thank you for a fantastic jQuery plug-in! I've been using it as part of an event management plug-in for WordPress. I needed a couple of drop-down filters added to the header of the calendar, so I've added an option: 'filters' which takes an object, with a filter ID as property, and a callback function as the value.

The filters are added along with the buttons (if the button name matches a filter), and the callback defines the mark-up. So more generally - anything can be added to the header of the calendar (so 'filters' might be a misleading name).

Would be great to see (something like) this added!

**Example usage:**
(I've omitted the defining of the category terms)

function category_dropdown(options){

//options.categories stores category term objects
var terms = options.categories;

//Generate HTML
var html="";
html+="
"+options.buttonText.cat+"
";
for (var i=0;i<2; i++) {
html+= "
"+terms[i].name+"
";
}
html+="";

return html;
}

$('#calendar').fullCalendar({
filters:{
category: category_dropdown,
},
header: {
left: 'category'
},
});