Here is a sneak peek at another TreeGrid solution:
Showing a custom item render in action: http://www.evangifford.com/treeGrid/screen1.jpg (Attempting to) show animated expansion and aggregate totals: http://www.evangifford.com/treeGrid/screen2.jpg I've used cairngorm for this project and so columns are actually stored on the ModelLocator. It is possible to make this generic so that one could pass in columns like a normal dataGrid but I don't have the time required to make it generic right now. In these examples above I've specified custom item renderers for almost every column. Dragging or rearranging columns using the header works as expected. Expanding a branch animates all renderers in. I've put in a little bonus for this project which shows the aggregate total for every category. DragMoveEnabled works with the dragProxy as expected and maintains hierarchy. You'll notice also that I'm turning on and off the DataGrid verticalGridLines based on the type of ValueObject passed into the renderer. This could be used to do just about anything to the renderer, including change row height based on the data passed in. Coming soon to a Flex component group near you! :^) -Evan _____ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Doug McCune Sent: Sunday, March 25, 2007 9:10 PM To: [email protected] Subject: Re: [flexcomponents] Re: Open-source TreeGrid component available I think Darron identified this problem: http://code. <http://code.google.com/p/flexlib/issues/detail?id=5&can=2&q=> google.com/p/flexlib/issues/detail?id=5&can=2&q= Read over his description, if it's the same issue then we've already got it logged, and we'll try to work on it. Or if you come up with a fix then let us know. If the issue is different then go ahead and log it as a new issue in the project issue register. Doug On 3/25/07, slangeberg < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> com> wrote: http://flexlib. <http://flexlib.googlecode.com/svn/trunk/examples/TreeGrid/TreeGrid_Sample.s wf> googlecode.com/svn/trunk/examples/TreeGrid/TreeGrid_Sample.swf When I tried this out, it still has serious issues with sorting. As in, sorting + opening nodes leads to mass chaos! -Scott On 3/23/07, Darron J. Schall < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> .com> wrote: The thing that makes development for Flex so interesting is that there a zillion different ways to do the same thing in the framework. The TreeGrid in FlexLib is done as an extension of the DataGrid. It basically keeps the original data provider in tact, and updates a "displayed data provider" based on a tree data descriptor. Just for comparison purposes: http://flexlib. <http://flexlib.googlecode.com/svn/trunk/src/flexlib/controls/TreeGrid.as> googlecode.com/svn/trunk/src/flexlib/controls/TreeGrid.as http://flexlib. <http://flexlib.googlecode.com/svn/trunk/examples/TreeGrid/TreeGrid_Sample.s wf> googlecode.com/svn/trunk/examples/TreeGrid/TreeGrid_Sample.swf .. and in case the list missed my announcement this week, the TreeGrid was contributed to FlexLib by Yaniv De Ridder - http://blogs. <http://blogs.adobe.com/yderidder/> adobe.com/yderidder/ -d Evan Gifford wrote: > > Hey Guys, > > I've got a full working TreeGrid not based on any previous work which > addresses all the issues faced with previous TreeGrids. > > Here is a tip: Don't start with the DataGrid! > > Start with the Tree. I started with the DataGrid also and added and > removed children from the collection upon clicking the "expand" and > "contract" buttons. There are two major issues with doing it this way. > > First problem is that you are actually duplicating items in the > dataProvider which is not how the dataProvider was meant to be used. I > believe that the underlying data structure should be left intact and > the view should represent the data, much like a View. > > Second problem is the list-to-hierarchy conversion. If you re-parent a > node visually, you'll have to do that in the dataProvider as well. > Imagine the difficulty of doing this with the drag-and-drop > functionality requirement of my project. > > If you look at the 3000+ lines of code for the Tree you find this > Hierarchy conversion already. Since both Tree and Datgrid inherit from > ListBase, it is possible to graft this Tree code into the DataGrid, > but I found a much simpler solution :^) > > In essence, I created a treeItemRenderer which does not assume that > the only part of the _data object displaying is the label. I put a > dataGrid inside this renderer and bound the columns back to the model. > I turned the headers off of these "renderer Data Grids" Then above the > tree I have a DataGrid which displays only headers. A change to this > header is handled by a method which writes the columns back to the > model which will then update each individual dataGridRenderer through > databinding. > > Works like a charm! > > I'm transitioning to a new job, new part of the country and getting > ready to get married in France in this next month, but I'll try to get > this component out to this group soon. > > -Evan > > ------------------------------------------------------------------------ > > *From:* flexcomponents@ <mailto:[email protected]> yahoogroups.com > [mailto:flexcomponents@ <mailto:[email protected]> yahoogroups.com] *On Behalf Of *Mike Matthys > *Sent:* Thursday, March 22, 2007 9:35 AM > *To:* flexcomponents@ <mailto:[email protected]> yahoogroups.com > *Subject:* [flexcomponents] Re: Open-source TreeGrid component available > > It looks as something is still wrong with the open and close > functions. When you open e.g. a root node up to its deepest level and > you try to close it completely by clicking the root node again, only > the number of rows below that root node equal to the number of > children the node hase. From then on the rows get completely mixed up > showing e.g. a child node of root node 1 below root node 2. > > Don't know what the best solution to this could be, but seems as you > need some kind of recursive close function (closing all children's > children and so on before closing the clicked node itself). > > I tried to build this into the treeGridNodeClosed function in the > TreeGrid class, but for some reason it won't work. > > Does anybody have ideas? > > Yahoo! Groups Links (Yahoo! ID required) mailto:flexcomponents- <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] -- : : ) Scott
