Question

I would like to only allow selection of Month and year on my DateSpinner. Is this possible in Flex SDK 4.7? Thx

Was it helpful?

Solution

It is not a setting you can enable/disable.

One approach could be to use the SpinnerList with the values of the years you want.

But you could also extend the DateSpinner and hide the components you don't want to see. If you look at the DateSpinner source you see three properties:

  /**
    *  The SpinnerList that shows the year field of the date.
    */
   protected var yearList:SpinnerList;

   /**
    *  The SpinnerList that shows the month field of the date.
    */
   protected var monthList:SpinnerList;

   /**
    *  The SpinnerList that shows the date field of the date.
    */
   protected var dateList:SpinnerList;

As soon as the spinners are initialized you can set their visibility and includeinlayout to false.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top