The List component has a lot more functionality than this component. Actually, I was trying to use the List component but It wasn't easy to remove the borders that this component generates for drawing the selection plus I didnt need the 80% of its functionality so I decided I needed a less complex component: just a vertical repeater accepting a custom itemRenderer.
ben.clinkinbeard escribió: > > How does your component differ from/why didn't you extend from List? > > --- In [email protected] > <mailto:flexcomponents%40yahoogroups.com>, Alberto Albericio <[EMAIL > PROTECTED]> > wrote: > > > > Hello all, > > > > Im creating a new component from scratch and I want to add itemRenderer > > support to it. Basically, it is a vertical repeater that accepts custom > > itemRenderers to render data. > > > > I have almost everything working but there's one point where I dont see > > the light :) > > > > My component extends from UIComponent and I create the renderers inside > > the commitProperties function: > > > > var renderer: * = > _itemRendererFactory.newInstance(); > > IDataRenderer(renderer).data = _items[i]; > > renderers[i] = renderer; > > renderer.x = 0; > > renderer.y = i * ( this._rowHeight + > > this._verticalGap ); > > addChild(renderer); > > > > > > Now, inside the updateDisplayList ( where I obtain the container's > width > > ) I resize the renderers: > > > > for each( var renderer: * in renderers ) { > > renderer.width = this.width; > > renderer.height = this._rowHeight; > > } > > > > This works if this._rowHeight == CustomRenderer.mxml's height BUT > > imagine I have a fixed height for the itemRenderer bigger than > > this._rowHeight. Lets say I use CustomRenderer.mxml ( an HBox with > > height="40" ), then, this component SHOULD show scrollbars on every > > renderer but, instead, it doenst show any scrollbar and thus I can only > > see the first this._rowHeight pixels defined for every renderer. > > > > What am I doing wrong? > > > > Thanks > > > > Alberto > > > >
