1 Reply Latest reply on Oct 29, 2007 1:14 PM by FRBAmy

    Styling of FIRST List/Tree Item

    FRBAmy
      Has anyone been able to set the style of the first item in a List and/or a Tree to something different than the rest of the items in that object?? HELP!!
        • 1. Re: Styling of FIRST List/Tree Item
          FRBAmy Level 1
          Finally got time to figure this out...here ya go if anyone else needs it:

          package{
          import mx.controls.listClasses.ListItemRenderer;

          public class FirstItemRenderer extends ListItemRenderer
          {

          public function FirstItemRenderer()
          {
          super();

          }

          override public function set data(value:Object):void {
          super.data = value;

          switch(super.listData.rowIndex) {
          case 0:
          this.setStyle("fontWeight","bold");
          break;
          default:
          this.setStyle("fontWeight","normal");
          }

          }

          }
          }