1 Reply Latest reply on Mar 26, 2010 9:20 AM by Mike6679

    CalendarLayout &  yearNavigationEnabled

    Mike6679 Level 1

      I'm creating a cutom calender Component using a Canvas which loads a CalendarLayout on top of it. I have been able to access all the DateChooser styles and properties with my CalendarLayout instance. The only one I cannot seem to access is yearNavigationEnabled to show the Numeric Year stepper....is there some trick to it or is it just not acessible?

       

      thanks

       

      -Mike

        • 1. Re: CalendarLayout &  yearNavigationEnabled
          Mike6679 Level 1

          I couldn't get yearNavigationEnabled to work but since this is a custom component I just simply added an up and down images and created event for each to step the year:

           

           

          public var dateGrid:CalendarLayout=new CalendarLayout();

           

          //------------------------------------------
                       private function onClickYear(Up:Boolean):void
                       {
                           var year:int = dateGrid.displayedYear;
                          
                           if(Up)
                               dateGrid.displayedYear=++year
                           else
                               dateGrid.displayedYear=--year;
                              
                           lblYear.text = String(year);
                              
                        }

           

          ------------------------------------------------------------------------------------------ -------------------------

          <!-- YEAR UP -->
              <mx:Image  source="{arrowUp}"
                         buttonMode="true"
                         x="{CALENDAR_YEAR_UP_X}"  y="{CALENDAR_YEAR_UP_Y}"
                         toolTip="{CALENDAR_YEAR_UP_TOOLTIP}"
                         click="onClickYear(true);"
                          height="5"/>
             
               <!-- YEAR Down -->          
               <mx:Image  source="{arrowDown}"
                         buttonMode="true"
                         x="{CALENDAR_YEAR_DOWN_X}"  y="{CALENDAR_YEAR_DOWN_Y}"
                         toolTip="{CALENDAR_YEAR_DOWN_TOOLTIP}"
                         click="onClickYear(false);" 
                          height="5.1"/>