CFOrgChart : Download Available

My CFOrgChart demo has gained a huge amount of interest from people and I have unexpectedly been flooded with requests for the code so here it is ;-)

2008-11-07 17:52:00.0

CFOrgChart : Download Available

Just a quick post as I havent posted in ages due to the considerable committments from Teamwork Project Manager

My CFOrgChart demo has gained a huge amount of interest from people and I have unexpectedly been flooded with requests for the code so here it is ;-)

DOWNLOAD ZIP FILE

I'll be updating this soon to:

  • Use Prototype.js for the AJAX
  • Use functions instead of Custom Tags for the recurrsion
  • Add more functionality
Tags: CFOrgChart
Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [5] - Leave a comment

Comments

Gary Fenton said:
Very, very good! :-) I can see this being used all over the place, especially intranets. Some suggestions - control over CSS for each level (e.g. SVPs in blue, VPs in green, Mgrs in red, workers in brown), different CSS for names and titles in a box (e.g. John Smith, Operations Manager), ability to put some text on or next to a line, use jQuery instead of Prototype. ;-) Good luck with this, you'll get loads of downloads via other blogs when they see this.
This is nice. Now all I need to do is come up with some way of using it.

P.S. What exactly does the install.exe do?
Hi Paul,

The install.exe was not meant to be in there! Removed and new package uploaded!

Dan.
Jose Alfonso said:
Hi Dan,
Interesting work. I kind of need something like this and I am willing to help build it further. I am kind of new to AJAX but a seasoned CF developer. Let me know if you have another build with the changes you mentioned you might be doing
9/11/2009 - Here is a recursive delete for all the child nodes. It is based on Plamen Balkanski's code at http://plamenbalkanski.blogspot.com/2007/11/have-you-ever-come-across-problem-where.html

It works in MS SQL, so you may have to modify for MySQL. I also changed the table and field names for my stuff, but tried to return them to their originals for this code.

DECLARE @list table (nodeId int, done bit)
DECLARE @curNID int <!--- -- current nodeID --->
DECLARE @cnt int <!--- -- a 'should continue' counter --->

SET @curNID = <cfqueryparam value="#url.nodeId#">
INSERT INTO @list VALUES(@curNID, 0)

SET @cnt = 1
WHILE @cnt > 0 BEGIN
<!--- -- get next unprocessed --->
SELECT top 1 @curNID = nodeId
FROM @list
WHERE done <> 1

SET @cnt = @@ROWCOUNT

IF @cnt > 0 BEGIN
<!--- -- this inserts the set of child nodes --->
INSERT INTO @list
SELECT nodeId, 0
FROM nodes
WHERE nodeParentId = @curNID
END

<!--- -- update in the list that it is done --->
UPDATE @list
SET done = 1
WHERE nodeId = @curNID
END

delete from nodes where nodeId in ( select nodeId from @list )