[OPEN-349] Change background color of days in Month View?

Request new features or modifications for Extensible components

[OPEN-349] Change background color of days in Month View?

Postby bhutten » Wed Oct 10, 2012 7:55 am

As the subject says - the calendar automatically changes the background colour of the current day in the Month view, but I'd like to be able to customize the colour of other days as well. Ideally something like a "getCellClass" method that would be called for each day in the month...

Is there currently any way to do this?
bhutten
 
Posts: 9
Joined: Sat Jun 30, 2012 8:13 am

Re: Change background color of days in Month View?

Postby brian.moeskau » Thu Oct 11, 2012 9:21 pm

Unfortunately there is no hook like a getCellClass method (that would be a nice addition, I'll consider adding something like that). The logic that controls that is inside the BoxLayout template class, in the applyTemplate method. Each day's styles are configured in this block, using the cellCls attribute:

Code: Select all
weeks[w].push({
    title: title,
    date: Ext.Date.clone(dt),
    titleCls: 'ext-cal-dtitle ' + (isToday ? ' ext-cal-dtitle-today' : '') +
        (w==0 ? ' ext-cal-dtitle-first' : '') +
        (prevMonth ? ' ext-cal-dtitle-prev' : '') +
        (nextMonth ? ' ext-cal-dtitle-next' : ''),
    cellCls: 'ext-cal-day ' + (isToday ? ' '+todayCls : '') +
        (d==0 ? ' ext-cal-day-first' : '') +
        (prevMonth ? ' '+prevMonthCls : '') +
        (nextMonth ? ' '+nextMonthCls : '') +
        (isWeekend && weekendCls ? ' '+weekendCls : '')
});

Currently you'd have to override applyTemplate to modify that unfortunately. I'll definitely aim to make that more flexible in a future release.
Personal Blog: Extraneous / Twitter: @bmoeskau / Meetup: Austin Bleeding Edge Web
User avatar
brian.moeskau
Site Admin
Site Admin
 
Posts: 1344
Joined: Sat Sep 18, 2010 5:00 pm
Location: Austin, Texas

Re: [OPEN-349] Change background color of days in Month View

Postby brian.moeskau » Thu Oct 11, 2012 9:25 pm

I've moved this to feature requests so it can be tracked appropriately.
Personal Blog: Extraneous / Twitter: @bmoeskau / Meetup: Austin Bleeding Edge Web
User avatar
brian.moeskau
Site Admin
Site Admin
 
Posts: 1344
Joined: Sat Sep 18, 2010 5:00 pm
Location: Austin, Texas


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron