2010-10-12 12 views

Répondre

1

J'ai obtenu une réponse de richfaces vitrine galerie,

il y a la propriété « isDayEnabled » là-bas, nous pouvons définir la fonction de script et nous pouvons le rendre handicapé.

<script> 
    var curDt = new Date(); 
    function disablementFunction(day) 
    { 
     if (day.date.getDay()==5 || day.date.getDay()==6 || day.date.getDate()==26) 
      return false; 
     return true; 
    } 
    function disabledClassesProv(day) 
    { 
     var res = ''; 
     if (day.date.getDay()==5 || day.date.getDay()==6 || day.date.getDate()==26) 
      res+='weekendBold '; 
     if (day.date.getDay()==5 || day.date.getDay()==6 || day.date.getDate()==26) 
      res+='everyThirdDay'; 
     return res; 
    } 
</script> 
      <tr> 
       <td> 
        <h:panelGrid id="panel" columns="2" columnClasses="ecol1, ecol2"> 
         <a4j:outputPanel id="calendar" layout="block"> 
          <rich:calendar value="#{UserRegister.sDate}" 
            popup="true" 
            datePattern="dd/M/yy hh:mm a" 
            showApplyButton="false" dayStyleClass="disabledClassesProv" isDayEnabled="disablementFunction" cellWidth="24px" cellHeight="22px" style="width:200px"/> 
         </a4j:outputPanel> 

         <h:panelGrid columns="2"> 

         </h:panelGrid> 

        </h:panelGrid> 
       </td> 
      </tr>