2012-10-31 36 views
2

我使用兩個ric:日曆一用於開始日期,另一個用於結束日期。禁用豐富臉部的日子4日曆組件

結束日期應根據開始日期選擇自動禁用所有以前的日期。

可以使用dayDisableClass嗎?

+0

這是一個循序漸進的例子告訴你如何突出並禁用某些日子。 http://www.tech-lead.blogspot.com/2012/10/highlight-certain-dates-in-component.html 它看起來可能不復雜。但它並不那麼困難。注意行 'modelItem.setEnabled(true);'它的竅門。 – prageeth

回答

2

Regadring的disabledDay方式...

看看這篇文章:Disable days on rich:Calendar

您也可以使用日曆CalendarDataModel - >CalendarDataModelItem - >isEnabled()

Boolean isEnabled() returns "true" if date is "selectable" on the calendar, the default implementation returns "true" 

看看at Demo

+0

只能從客戶端使用 user1787828

+0

查看我在我的答案中發佈的鏈接... http://devharbor.blogspot.co.il/2009/08/disable-days-上richcalendar.html – Daniel

0

You coul d使用日曆的屬性dayDisableFunction並定義你的JavaScript函數,將定義哪些天被禁用:

<rich:calendar dayDisableFunction="disablementFunction" ...</rich:calendar> 

例如JS功能:

function disablementFunction(day) { 
    if (day.isWeekend) return false; 
    return true; 
}