canvs / fullcalendar

Automatically exported from code.google.com/p/fullcalendar
0 stars 0 forks source link

Event Types - Classes - With Solution #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Needed to have different types of events listed on the calendar .. eg
Office Events, Personal Events, Holidays etc   so came up with this solution..

the returned CalEvent has an optional "class" attribute.. then in the
fullcalendar.js i added the following lines

before line 433 ( buildEventText(event, element.find('td.c')); )
i added:
  if (typeof event.class != 'undefined' && event.class != '') {
element.addClass(event.class);
}

I know this can be achieved via the eventRender option 

eventRender: function(event,element) {
 if (typeof event.class != 'undefined' && event.class != '') {
   element.addClass(event.class);
  }         
}

but this support "out of the box" would be good.

eg if the event's class is officeEvent, then css code can then be added as so:
.full-calendar-month .officeEvent td { 
background: #35698F !important; 
color: #FFF !important; 
}
// this changes the event's colouring to make it differentiable from other
events

Original issue reported on code.google.com by Totally....@gmail.com on 14 May 2009 at 4:09

GoogleCodeExporter commented 9 years ago
apologies that it's marked as a defect.. should have been an "enhancement"

Original comment by Totally....@gmail.com on 14 May 2009 at 4:47

GoogleCodeExporter commented 9 years ago
this is very reasonable and only takes up about 1 line. committed this to the 
trunk
(though I chose to use "cssClass" instead of just "class"... reserved word) 
will be
in version 1.2. thanks

Original comment by adamrs...@gmail.com on 17 May 2009 at 5:45

GoogleCodeExporter commented 9 years ago
Great. Thanks.. Be Good to see v1.2 so far it's an excellent job :)

Original comment by Totally....@gmail.com on 25 May 2009 at 6:36

GoogleCodeExporter commented 9 years ago
version 1.2 just released. has this "className" option... see docs. thanks

Original comment by adamrs...@gmail.com on 1 Jun 2009 at 5:16

GoogleCodeExporter commented 9 years ago
No Thank You :)

Original comment by Totally....@gmail.com on 1 Jun 2009 at 9:48

GoogleCodeExporter commented 9 years ago

Original comment by adamrs...@gmail.com on 14 Aug 2013 at 2:11

GoogleCodeExporter commented 9 years ago

Original comment by adamrs...@gmail.com on 14 Aug 2013 at 2:12