This content has been marked as final. Show 3 replies
"MacGyverMan" <email@example.com> wrote in message
> I've got flat data coming from AMFPHP as an array collection of objects
> properties such as
> Some of the data is special, marked as an "adder" (adder=1). The adder
> show up at the top of the list and have a specific icon (plus sign or
> something). All other entries must be sorted alphabetically under the
> adder and
> have another icon (trash can).
> When the user clicks the "adder", they edit their new entry, upon
> the entry is added to the list and the adder is maintained. A behaviour
> to powerpoint when creating bullets (a temporary entry awaits an edit, if
> is one, a new entry is created).
> I've been reading until I can't stand it anymore...people talk about
> item renders, subclassing etc. I understand that, however, I have no clue
> I need to do (which function(s) to overload) to achieve this behaviour.
> Also, the data is grouped via a grouping collection, so that the user can
> navigate to a specific day, grade and then class to add/edit. Again, I'd
> to change the icons for the folders based on their function.
> In summary:
> 1. What do I do to customize the sorting of data in the ADG (take an item
> of the sort and put it first).
I think the only kind of Hierarchical Collection you can do this with is a
GroupingCollection. You'll need to use a compareFunction on the Grouping
and/or GroupingField to always return -1 for that particular item.
> 2. What do I do to change the icons for specific leaf nodes so that some
> will be trash cans and others will be plus signs.
Look at iconFunction.
Despite what the docs for AdvancedDataGrid say, it _does_ support the
> 3. What do I do to change the itemClick behaviour so that if the user
> an item with a trash can, the item is deleted but not if the user clicks
> item witha plus sign.
The ListEvent you get from itemClick will have a property called
currentTarget. If you look at currentTarget.data, it will have the
information for the entire row. Check whatever property you used in your
iconFunction to show the trash can vs. the plus sign, and perform the
> 4. What do I do to change the folder icon based on the item type and the
> depth (so that each level has a different icon).
Look at the docs for groupIconFunction.
> If this is simple, I apologize. Everything seems simple for people in
> and yet I've been working tens of hours on this stupid problem and cannot
> it. Flex could be great if I could understand the damn thing....Go PHP!
It takes everyone a long time to figure out what's going on in Flex, but
once you do, it is amazing :-).
I did an example with a GroupingCollection that you may or may not find
useful, since I deliberately was _not_ using it for an ADG.
I also have a demo here that shows using an iconFunction, though, again, not
with an ADG
Thanks Amy, I'll have a look at that when I get home from work.
God I hate trying to understand flex...it seems like it was engineered to be too simple and too powerful, consequently, I can't find anything I need :o)
..oops posted in wrong thread...