Kevincosme / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

Some DataGrid improvements - Restore openItems and autoRowCount #18

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Bind a TreeGrid to a dataprovider
2. Expand some items
3. Adjust some of the data in the provider and rebind

What is the expected output? What do you see instead?
It would be nice of the control offered a flag to restore the open items on
a dataprovider change, right now it just resets the openItems to {} when
the dataProvider changes. (Some of this is in the attachment but it doesn't
seem to work for me, probably something to do with UID).

Attached is an extension that overrides the open/close methods and expands
the rowcount of the tree to fit all the open items.

What version of the product are you using? On what operating system?
Flex 2.0.1, WinXP

Please provide any additional information below.

Original issue reported on code.google.com by corey.ma...@gmail.com on 10 Apr 2007 at 6:39

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by dmcc...@gmail.com on 30 Jun 2007 at 11:16

GoogleCodeExporter commented 8 years ago

Original comment by dmcc...@gmail.com on 26 Dec 2007 at 11:46

GoogleCodeExporter commented 8 years ago
I have modified my treeGrid code in a big way so that it has a number of fixes 
and
functionality improvements from the downloadable version.  For starters I have 
fixed
the openItemAt and closeItemAt methods so they both work properly and so that 
you
don't necessarily need to feed in the item (you can just feed in the row number
instead).  I have also added a couple methods.  

Firstly I have added an allItems() function that returns an ArrayCollection
containing a list of all the items. 

I have also added an allItemsWithoutRoot() function which returns an 
ArrayCollection
containing all the items in the tree without the root.

I have also added in an openAllItems() method which opens all items in the 
treeGrid
with one call similar to the closeAllItems() method but the opposite.  

Lastly I have added a method called 
replaceDataProviderPreserveTreeState(item:*).  
This method replaces the current data provider but loops through the list of 
items in
the old data provider to see if there are any items that match in the old 
provider
with items in the new provider and then opens the items in the new display list 
if
they were open already in the old display state.  This preserves the state of 
old
tree nodes (keeping them opened/closed depending on how they were before) while 
still
adding any new and updated nodes that might be children of this new data 
provider. 
It will also reselect the same item(s) that was/were selected prior to the data
provider update (assuming there was an item selected).

I'm sure that all of these would be helpful to most of the treeGrid users and I 
think
that with a little more changes this component could really be useful to a lot 
of people.

See my attached TreeGrid.as file for more information.

Original comment by bdub...@gmail.com on 19 Feb 2009 at 4:44

Attachments: