I had to implement this for a project.
Check out:
http://www.arpitonline.com/blog/?p=42<http://www.arpitonline.com/blog/downloads/numberedList2/>

On 6/14/07, Alex Harui <[EMAIL PROTECTED]> wrote:

   updateDisplayList is for updating all visuals including the text in
labels.  I think I would call itemRendererToIndex in updateDisplayList and
modify the text at that time.  Actually, I'd probably have a separate label
just for the number and modify that.


 ------------------------------

*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *williamkusumo
*Sent:* Thursday, June 14, 2007 12:44 PM
*To:* [email protected]
*Subject:* [flexcoders] Re: Show incremental numeric index in a List



Thanks for the feedback, guys!

I implemented IDropInListItemRenderer and got ahold of listData.owner.
You are right, itemRendererToIndex(...) will get you the correct index.

The trouble now is how do I bind the result of itemRendererToIndex to
a label inside the itemRenderer so that it automatically updates when
the dataProvider is changed?

You mentioned overriding updateDisplayList(), isn't that function
related more to updating the styles?

Thanks again!

--- In [email protected] <flexcoders%40yahoogroups.com>, "Alex
Harui" <[EMAIL PROTECTED]> wrote:
>
> You can implement IDropInListItemRenderer in your HBox if you want.
>
>
>
> You can also assume that "owner" is the List and call
> itemRendererToIndex in an override of updateDisplayList().
>
>
>
> ________________________________
>
> From: [email protected] <flexcoders%40yahoogroups.com> [mailto:
[email protected] <flexcoders%40yahoogroups.com>] On
> Behalf Of williamkusumo
> Sent: Wednesday, June 13, 2007 5:53 PM
> To: [email protected] <flexcoders%40yahoogroups.com>
> Subject: [flexcoders] Re: Show incremental numeric index in a List
>
>
>
> A quick note: The itemRenderer is based on HBox. So it does not
> implement IDropInListItemRenderer, thus I don't have reference to
> listData.
>
> --- In [email protected] <flexcoders%40yahoogroups.com><mailto:
flexcoders% <flexcoders%25>40yahoogroups.com>
> , "williamkusumo" <williamkusumo@>
> wrote:
> >
> > Hi!
> >
> > I have a List bounded to a dataProvider and an itemRenderer. Could
> > anyone advice me on how I can insert an incremental numeric index in
> > each list item (1, 2, 3, and so on)? This list can be re-arranged via
> > drag-n-drop, so I can't put the index as part of the data.
> >
> > Any help will be greatly appreciated.
> >
> > Thanks!
> >
>




--
Arpit Mathur
Lead Software Engineer,
Comcast Interactive Media
---------------------------------------
post your flex tips on
http://flextips.corank.com

Reply via email to