| Issue 18: | Some DataGrid improvements - Restore openItems and autoRowCount | |
| 4 people starred this issue and may be notified of changes. | Back to list |
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.
|
|
,
Jun 30, 2007
(No comment was entered for this change.)
Labels: -Type-Defect Type-Patch TreeGrid
|
|
,
Dec 26, 2007
(No comment was entered for this change.)
Labels: -TreeGrid FlexLib-TreeGrid
|
|
,
Feb 19, 2009
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. |
|
| ► Sign in to add a comment |