Jeremi,
    Agreed. Manipulation part (addNode, events etc ) threw me off  as it seemed that you wanted Tree API and DataGrid-like cell renderer. Very nice control.
Regards,
Anatole
 
----- Original Message -----
From: jeremy lu
Sent: Sunday, April 23, 2006 2:41 AM
Subject: Re: [flexcoders] How would I do something like this....


hi Anatole,

I'm talking about datagrid too, never thought about extending tree and add in those function. (especially in flex 2 the implementation changed a lot).

I should add this to my original post:

if what the user want is providing a *view* into the hierarchy data, then a simple item renderer inside first column of the datagrid should do the trick, this should just take 2-3 days.

but the project I'm working on (which will be public in the end of May) requires the capability to let user manipulate those nodes (add/remove/rename/drag-drop/cut/copy/paste), which made it a lot complex then I original thought. (acutally what you said is what I thought it should be in the beginning - that weekend when I started prototyping - but after digging into it I found that's totally another story)


jeremy.



On 4/23/06, Anatole Tartakovsky <[EMAIL PROTECTED]> wrote:
Jeremy,
    Actually, I was not suggesting to rewrite UI/datagrid - I was suggesting not to use tree - datagrid would work fine the way it is now. The changes to datagrid would be very "localized": just sorting to take in consideration the hierarchy (essentially making sure you have custom sort function based on parent preceding column  sort), minor changes like making sure first column locking works, etc. In either case the code is based on datagrid and not on the tree, with opening/closing of the nodes based upon filtering of the data, add custom renderer to the first column to paint / outdent first label and integrate it with filter function.
    Quick and dirty approach allows you to do most of that code inline within the mxml/data definition itself doing the above code explicitly.
 
Thank you,
Anatole
 
PS. Obviously, disabling sorting or column reordering would further simplify the task.
 
 
----- Original Message -----
Sent: Saturday, April 22, 2006 11:14 PM
Subject: Re: [flexcoders] How would I do something like this....


well, just flip thru my gridtree component (http://tinyurl.com/grcfs) developed two months ago (which is still in a mess), it's around 2000 lines of code (after refactoring it three times) and lot of algorithm behind to handle following function:

addNode
removeNode
cutNode
copyNode
pasteNode
indent/outdent code

I think the first methods Anatole mentioned will definitely be a b***h to tackel with, for the nature of List-based component is a little bit tricky then it looks (all the list items are dynamically generated and draw on the screen, this will cause some trouble)

I'm currently implementing gridtree using item renderer for the first column, it's pretty much the same work to extends gridbase and "inject" the tree grid code into it so the API would be more compatible, by using this method I could easily feed a non-xml structure (ie:resultset from java/php) to the component and let it draw the hierarchy and set indent/outdent of each node.

now I'm thinking maybe I should draw those lines and plus sign instead of a simple arrowhead, so it's more like VS2005  :-)

FYI, the component took a whole weekend for prototyping  and concept-proofing, *but*, it took almost one and a half month for debugging and refactoring to stablize the code and become really usable in the on-going product/project.

originally I want to open-source the component but later on this become one of my assigned  day-job project (so I can fulltime developing it with the approval of my employer), but anyway, I would love to answer any related questions.

jeremy.


On 4/23/06, Anatole Tartakovsky <[EMAIL PROTECTED]> wrote:
Depends on your requirements:
For generic case it is 3 step process:
1. Wait for beta 3 that supposely comes with the source code.
2. Study the code for data grid header, treeview, datagrid, etc
3. Write your own code for the control inherited on the top of BaseGrid, with automatic wrapper for the first column - 1500-2000 lines in total to support generic case
 
For quick and dirty :
Create first column as cell renderer. I believe I posted code in this group for Flex 1.5 tree cell renderer that allowed to add nodes lines to the regular tree - you just paint it within item - still about 200 lines of code for core functionality, another 100 lines for cascade retrieve/grouped sort on the header clicks, 2-3 days of work altogether
 
Have not seen anything in the public domain, just few developed "for hire" in consulting gigs.
 
HTH,
Anatole




YAHOO! GROUPS LINKS






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to