- the Calendar object describing the month that needs tobe rendered
Returns the markup for rendering the calendar month view
Returns the markup for rendering the calendar month view
- the calendar items than need to be rendered
- Ajax function to be called when a calendar item was clicked. It takes two parameters: elem the node that was clicked and param the identifier if this CalendarItem
- Ajax function to be called when a day number(cell header) item was clicked It takes two parameters: elem the node that was clicked and param the date of the clicked day in MM/dd/yyyy format
- Ajax function to be called when a day number(cell header) item was clicked It takes two parameters: elem the node that was clicked and the week number
NodeSeq - the markup to be rendered
- the Calendar object describing the month that needs tobe rendered
CalendarMonthView renders a month view representation of a collection of CalendarItem
Usage example - assume CalendarView is a typical LiftWeb snippet
class CalendarView { def render(html: Group) : NodeSeq = { val c = Calendar getInstance; c.set(MONTH, 4) bind("cal", html, "widget" --> CalendarMonthView(c, makeCals, itemClick, dayClick, weekClick) ) } import JE._ import JsCmds._ def itemClick = Full(AnonFunc("elem, param", JsRaw("alert(param + ' - ' + elem.nodeName)"))) def dayClick = Full(AnonFunc("elem, param", JsRaw("alert(param + ' - ' + elem.nodeName)"))) def weekClick = Full(AnonFunc("elem, param", JsRaw("alert(param + ' - ' + elem.nodeName)"))) private def makeCals = { val c1 = Calendar getInstance val c2 = Calendar getInstance; val c3 = Calendar getInstance; c2.set(DAY_OF_MONTH, 3) c3.set(DAY_OF_MONTH, 1) c3.set(MONTH, 4) val item1 = CalendarItem(...) val item2 = CalendarItem(...) val item3 = CalendarItem(...) item1 :: item2 :: item3 :: Nil } }