Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3442792
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:42:44+00:00 2026-05-18T08:42:44+00:00

I created a Custom Day Render and I would like to access some custom

  • 0

I created a Custom Day Render and I would like to access some custom data that I am providing with in the Flextras Calendar dataProvider.

here is the code that I have

    <flextras:Calendar
  id="calendar"
  dayRenderer="com.healthways.healthhonors.itemrenderers.MyAwesomeDayRenderer"
  monthHeaderRenderer="com.healthways.healthhonors.itemrenderers.MyAwesomeMonthRenderer"
  displayedYear="2010"
  displayedDate="1"
  displayedMonth="10"
  dateField="data"
  width="100%"
  height="100%"
  />

Here is the type of Object that I am creating and storying in an ArrayCollection witch gets passed to the Calenders dataProvider

myArrayCollection = new ArrayCollection([{date:new Date(), data:myObject}])

Here is what what my Day Render looks like

    package com.healthways.healthhonors.itemrenderers
{
 import com.healthways.vo.DateVO;
 import nl.demonsters.debugger.MonsterDebugger;
 import com.healthways.vo.MedicationVO;
 import mx.collections.ArrayCollection;
 import mx.utils.ObjectUtil;
 import com.flextras.calendar.IDayDataVO;
 import com.flextras.calendar.ICalendarDataVO;
 import mx.events.ResizeEvent;
 import mx.events.FlexEvent;
 import com.healthways.components.DailyPieChart;
 import com.flextras.calendar.defaultRenderers.DayRenderer;

 /**
  * @author Matthew Wallace
  */
 public class CalendarMedicationRenderer extends DayRenderer
 {
  private var chart : DailyPieChart;
  public function CalendarMedicationRenderer()
  {
   init();

  }

  private function init() : void
  {
   percentWidth = 100;
   percentHeight = 100;

   chart = new DailyPieChart();
   this.addElement(chart);    

   addEventListener(ResizeEvent.RESIZE, onResize);
   addEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete);
  }

  private function onCreationComplete(event : FlexEvent) : void
  {
         /* here I would like to set chart display object visible
                          based on if I have custom data in the renderer or not */
  }

  private function onResize(event : ResizeEvent) : void
  {
   chart.x = (width * 0.5) - 25;
   chart.y = (height * 0.5) - 25;
  }


  override protected function createExpandDayButton() : void
  {
   //super.createExpandDayButton();
  }

  override protected function createDayTextField() : void
  {
   //super.createDayTextField();
  }


 }
}

what I need to understand is how to see if a renderer has custom data so that I can do some logic on the renderers creation complete.

thanks,
Matthew

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:42:45+00:00Added an answer on May 18, 2026 at 8:42 am

    The dayRenderer in the Flextras Calendar is, conceptually, modeled after itemRenderers in the Flex list based classes. That means the renderer may be reused when you change a month, day, or year, replacing the current data.

    In your current dayRenderer, it is likely you are executing the init() method before any data is set.

    You should tie into the Flex Component Lifecycle to make changes when data is created (or changed) instead of using creationComplete. Since you want to examine the dataProvider, you should look at the dayData object. I would override the set method, something like this:

    protected var dayDataChanged : Boolean = false;
    
    override public function set dayData(value:IDayDataVO):void{
        super._dayData = value;
        this.dayDataChanged = true;
        this.invalidateProperties();
    }
    

    You could also make this a bit more advanced to compare the current dataProvider with the new one to see if anything has changed, and invalidateProperties() conditionally if it has / has not.

    In commitProperties(), try something like this:

    if(this.dayDataChanged == true){
     // access this.dayData.dataProvider and perform whatever processing is needed
     this.dayDataChanged = false;
    }
    

    I will add that with your current dataProvider item, the date will default to ‘today’, which is unusual. The date is not usually set dynamically to the current date.

    I’ll also add The dateField in your dataProvider is named ‘date’ but the dateField property you specify is ‘data’. In that situation, the Calendar may never send a dataPRovider’s data to the dayRenderer because it cannot determine what day it should end up on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi i would like to create a custom calendar, this calendar will have custom
I created a custom calendar for my calendar app ... but I have some
I created a custom calendar for iOS , and I am trying using badge
I have created an arraylist that is made up of custom objects. Basically the
I've created a custom validation on a Apt model that verifies that an appointment
I would like to calculate a duration whereas 1 day will consist of 8
I created custom adapter for listview which contain text and images, on click of
I've created custom toggle slide animation. Its working fine as expected but its not
I have created custom posts and I want one page in my site to
I have created custom jQuery UI widget called uiPopover, very similar to UI-dialog (in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.