First , in css , the classes are defined with "." before name them , then it's so : .trainning , .project_work ....
With this answer : http://stackoverflow.com/questions/31322105/full-calendar-rails-adding-custom-css-classes-to-events/33894043#33894043 <http://www.google.com/url?q=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F31322105%2Ffull-calendar-rails-adding-custom-css-classes-to-events%2F33894043%2333894043&sa=D&sntz=1&usg=AFQjCNEKUiXJtKIK7YA3Xo6o4EX1VNKKbw> It's possible to use a custom function in javascript to handle events of calendar, by example: To create classes: .meeting{ background-color: green; border-color: black; color: #fff; } .training{ background-color: green; border-color: black; color: #fff; } .project_work{ background-color: blue; border-color: black; color: #fff; } with classes created you should capture type of event via javascript: $('#calendar').fullCalendar({ ... eventRender: eventRenderCallback, ...}); function eventRenderCallback(event, element){ if (event.type == "TRAINING"){ element.classList.add('training'); }else if (event.type == "MEETING"){ element.classList.add('meeting'); }else if (event.type == 'PROJECT_WORK'){ element.classList.add('project_work'); } } How you already have classes created , on event javascript get each event of calendar and will make verification of type ( here use variable of event that represent the type his ) and add class respective. Anyway just call me , I think that I added a lot of things. Em domingo, 2 de outubro de 2016 16:50:09 UTC-3, Peter escreveu: > > > Thanks Marlysson, > > > > Assuming row.task.task_type can be one of [ 'TRAINING' , > 'MEETING' , 'PROJECT_WORK''] > > I want the event background to be RED GREEN or BLUE respectively. > > > Do I add code something like this to the CSS file > > .myclass, > .fc-agenda .myclass .fc-event-time, > .myclass TRAINING { > background-color: red; > border-color: black; > color: #fff; > } > > .myclass, > .fc-agenda .myclass .fc-event-time, > .myclass MEETING { > background-color: green; > border-color: black; > color: #fff; > } > > .myclass, > .fc-agenda .myclass .fc-event-time, > .myclass PROJECT_WORK { > background-color: blue; > border-color: black; > color: #fff; > } > > > > then how to I call it from the calendar view included (see original post)? > > > Peter > > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.