6 Replies Latest reply on Dec 23, 2009 11:50 PM by Shongrunden

    ItemRender height - defaults to about 100

    cartman1138 Level 1


      I am trying to make an item renderer that will have a border. So I based it on Border and implemented DataRenderer. When it renders the height is 113. I don't set an explicit height because it needs to be able to grow based on what is in it. Shouldn't the border collapse down to the size of it's contents? Any thoughts? The code is below.







      <?xml version="1.0" encoding="utf-8"?>
      <s:Border xmlns:fx="http://ns.adobe.com/mxml/2009" implements="mx.core.IDataRenderer"
          borderColor="#FF0000" width="100%" minHeight="20">
              [Event(name="dataChange", type="mx.events.FlexEvent")]
              import com.lhl.fx.ordering.domain.MenuItem;
              import com.lhl.fx.ordering.util.FormattingUtils;
              import mx.core.IDataRenderer;
              import mx.events.FlexEvent;
              private var _data:Object;
              public function get data() : Object {
                  return _data;
              public function set data(value : Object) : void {
                  _data = value;
                  dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
              <!-- Place non-visual elements (e.g., services, value objects) here -->
          <s:RichText x="2" y="2" width="150" text="{ data.name }" fontWeight="bold"/>
          <s:RichText right="2" y="2" width="40" height="15" text="{ data.price }" textAlign="right" fontWeight="bold"/>