| Issue 6: | Add Event Class Property | |
| 2 people starred this issue and may be notified of changes. | Back to list |
Would need to be able to have styling option per event to signify event types or calendar group. Assigning a class per element would be perfect. Great work to this point.
May 4, 2009
Project Member
#1
adamrs...@gmail.com
May 4, 2009
(No comment was entered for this change.)
Status:
Done
May 4, 2009
Can you explain how I can identify the element that is going to be added to the DOM? I cannot locate anything about it in the documntation.
May 4, 2009
the element that is going to be added to the dom is *passed* into the function. heres
an example of what you might want to do:
eventRender: function(event, element) {
if (event.type == 'meeting') {
element.addClass('meeting');
}
}
May 4, 2009
This is close to what would work, but ideally I would want to update the follwing style call based on 'type' : .full-calendar-month .event td Is this possible?
May 4, 2009
in the context of my previous example, you could have the following line in a stylesheet:
.full-calendar-month .meeting td { background: red }
OR, you could change the javascript to do the same things:
eventRender: function(event, element) {
if (event.type == 'meeting') {
element.find('td').css('background', 'red');
}
}
May 4, 2009
Great! Thanks for the help. I ended up searching out certain styles so I could
maintain the rounded look:
eventRender: function(event, element) {
switch (event.type){
case 'event' :
element.find('.n, .w, .c, .e, .s').css('background-color', '#00cc33');
break;
case 'project' :
element.find('.n, .w, .c, .e, .s').css('background-color', 'red');
break;
default :
break;
}
},
May 5, 2009
cool, glad you got it to work |
|
| ► Sign in to add a comment |