1 Reply Latest reply on Oct 5, 2007 11:24 PM by Gregory Lafrance

    DateChooser

    mvdprasad
      Hi,

      Iam using Adobe Flex 2 ...I working on datachooser control .actually my Requirement is Just like Microsoft project plane
      type . When I single click on Particular day change the that day cell color and When I dodule click on Particular day change the that day color cell that is my Requirement any one working on this control plz Help me

      Regards ,

      prasad
        • 1. Re: DateChooser
          Gregory Lafrance Level 6
          This might help out:

          <?xml version="1.0"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="init()">
          <mx:Script>
          <![CDATA[
          private var origColor:uint;
          private function init():void {
          origColor = dc.getStyle("selectionColor");
          }

          public function setBackGrdColors(newColor:uint):void {
          dc.setStyle("selectionColor", origColor);
          if(dc.selectedDate){
          var dayOfWeek:Number = dc.selectedDate.day;
          }
          else{
          return;
          }
          switch(dayOfWeek) {
          case 0:
          if(sun.selected)
          dc.setStyle("selectionColor", newColor);
          break;
          case 1:
          if(mon.selected)
          dc.setStyle("selectionColor", newColor);
          break;
          case 2:
          if(tue.selected)
          dc.setStyle("selectionColor", newColor);
          break;
          case 3:
          if(wed.selected)
          dc.setStyle("selectionColor", newColor);
          break;
          case 4:
          if(thu.selected)
          dc.setStyle("selectionColor", newColor);
          break;
          case 5:
          if(fri.selected)
          dc.setStyle("selectionColor", newColor);
          break;
          case 6:
          if(sat.selected)
          dc.setStyle("selectionColor", newColor);
          break;
          default:
          break;
          }
          }
          ]]>
          </mx:Script>
          <mx:VBox horizontalAlign="center" verticalGap="20">
          <mx:DateChooser id="dc" textAlign="left" change="setBackGrdColors(cellColor.selectedColor)"/>
          <mx:HBox width="100%" horizontalAlign="center">
          <mx:CheckBox id="sun" label="Sun"/>
          <mx:CheckBox id="mon" label="Mon"/>
          <mx:CheckBox id="tue" label="Tue"/>
          <mx:CheckBox id="wed" label="Wed"/>
          </mx:HBox>
          <mx:HBox width="100%" horizontalAlign="center">
          <mx:CheckBox id="thu" label="Thu"/>
          <mx:CheckBox id="fri" label="Fri"/>
          <mx:CheckBox id="sat" label="Sat"/>
          </mx:HBox>
          <mx:HBox width="300" horizontalAlign="center">
          <mx:Label text="Background Color" />
          <mx:ColorPicker id="cellColor" selectedColor="#FF00FF"/>
          </mx:HBox>
          </mx:VBox>
          </mx:Application>