2 Replies Latest reply on Oct 23, 2006 1:56 AM by Vision Airlines

    Dynamic ItemRenderer

    Vision Airlines
      I've racked my brain to find an answer to this to no avail. Here goes:

      I have a dataGrid with 2 columns.
      The first column has one of two values. We'll say A or B.

      The 2nd column contains date values. There is an itemRenderer on this column that changes the text color of the date to red if the date is past due.

      If column 1 has a value of A. I want the date in column 2 to be past due after 6 months.
      If column 1 has a value of B. I want the date in column 2 to be past due after 1 year.

      Now here's the trick.
      I image one of the following two solutions would work, but I'm not sure how to implement either:

      1. Call the value from the 1st column Inside the .as that is the itemRenderer for column 2. Then, I could write a condition for when the itemRenderer would change the column 2 date color. Anyone know if this is doable?
      or
      2. Is there a way to dynamically assign an itemRenderer to a column? Then, I could use the values from column 1 to determine which itemRender to assign.

      Feel my pain?
      I promise to jump up and down with extreme joy if someone would help me figure this out..