RE: DHTML recursion problem

2004-07-29 Thread Micha Schopman
Just a word of advice, place the entire business logic of recursion in a
stored procedure. What you do know, is make numerous calls to the
database server, which is by far, more slower and cpu intensive than
putting the job at SQL Server.

 
tSQL gives you enough functions and possibilities to get recursive
functions.

 
This means, you only call the database once, and then you get a nice
result set back ready to use.

Micha Schopman
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: DHTML recursion problem

2004-07-29 Thread Metzy Martinez
It's extremely fustrating. I'm trying to convert JAVA code into coldFusion and i tried to go with CFTREE but there is a problem with it ColdFusion 5 server. I tried to implement the recursive tree function found in the o'reilly ColdFusion 5 book. that of course is using CFtree.
ughhh.

thanks for your help :)
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




DHTML recursion problem

2004-07-28 Thread Metzy Martinez
Hello,

I'm trying to create windows explorer style directory structure. And I'm some issues. My folder end up nesting inside of themselves.

Here is my code its a custom tag that calls itself when it finds children

cfoutput

cfif isdefined(attributes.parentItemIdx)
	cfset parentItemId=#attributes.parentItemIdx#

cfelse
	cfset parentItemId = 0
/cfif

cfquery name=get_parents
	SELECT 
		*
	FROM
		participant_assess_actn_doc
	WHERE
		path_name = '#parentItemId#'
	ORDER BY 
		file_name
/cfquery

cfloop query=get_parents
 cfif get_parents.recordcount gt 0
		div id=#get_parents.participant_assess_actn_doc_id# class='FolderOff' >
	cfelse
		div id=#get_parents.participant_assess_actn_doc_id# class='FolderOff' >
	/cfif
	img src='' border='0' id='folder#get_parents.participant_assess_actn_doc_id#'
	span id='texthtml#get_parents.participant_assess_actn_doc_id#' value='#get_parents.participant_assess_actn_doc_id#'#file_name#/span
	/div
	cfquery name=get_children
		SELECT 
			*
		FROM
			participant_assess_actn_doc	
		WHERE
			path_name = '#get_parents.participant_assess_actn_doc_id#'
	/cfquery
	 
	
	

	cfif get_children.recordcount gt 0
	 	span class='branch' id='branch#get_parents.participant_assess_actn_doc_id#'
	/cfif
	cfif #get_parents.participant_assess_actn_doc_id#EQ #parentItemId#
		
		cfmodule template=JMenuBuilder.cfmqass_data_source=d018_reacs_qass parentItemIdx= #get_parents.participant_assess_actn_doc_id#
	/CFIF
/CFLOOP
/cfoutput

Thanks in advance for any help :)
Metzy
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: DHTML recursion problem

2004-07-28 Thread stylo stylo
I don't know, but it's a nasty way to do it. 

First of all, you don't need to call every function in the onclick (lowercase, not camelCase). Just send the needed var to a function and go from there.

Secondly, you should not even have cf put onclick inline; just have a class on the nec. menu items, then use js to add the onclick via a getElementsByClassName script. The images can also be background images associated with a class.

See here for some ideas:
http://www.kryogenix.org/code/browser/aqlists/

I understand, however, if you are stuck with a script that's not yours :-(
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]