We help IT Professionals succeed at work.

HMTL - Looping <TBody>

Wirt
Wirt asked
on
395 Views
Last Modified: 2013-12-24
I need help with my <TBODY> tags graping the right rows when i hidden them. For some reason when i hide my DIR<TBODY> it only grabs the first MANAGER.
I think it might be a problem with my loop but i cant find it.
DIR
---MANAGER
---------EMEPLOYEE
---------EMEPLOYEE
---------SUB_MANAGER
---------EMEPLOYEE
---------EMEPLOYEE
---MANAGER 2
---------EMEPLOYEE
---------EMEPLOYEE
---------SUB_MANAGER
---------EMEPLOYEE
---------EMEPLOYEE
DIR2
---MANAGER
---------EMEPLOYEE
---------EMEPLOYEE
---------SUB_MANAGER
---------EMEPLOYEE
---------EMEPLOYEE
---MANAGER2
---------EMEPLOYEE
---------EMEPLOYEE
---------SUB_MANAGER
---------EMEPLOYEE
---------EMEPLOYEE




<script type="text/JavaScript">
 
 
function ToggleRowDisplay( objTargetButton, whichBody )
 
{
  // Variables
  			//alert(whichBody);
           var strDisplay = "block";
           var objTableBody = document.getElementById(whichBody);
           var strButtonValue = "-";
      
            // Toggle Display
            if( objTargetButton.value == "-" )
            {
                  // Hide
                  strDisplay = "none";
                  strButtonValue = "+";
            }
      
            // Toggle the table
            objTableBody.style.display = strDisplay;
            
            // Set button Value
            objTargetButton.value = strButtonValue;
}
 
</script>   
 
 
 
 
 
 <!---Grab Director --->
<cfloop query="getDirectorsList">
      <cfset go_Dir_List = processDirectors(#getDirectorsList.DIR#)>
      <TR class="dirRow">
        <TD align="left"><cfset directorName = getLastName(#getDirectorsList.DIR#)> <cfoutput>#directorName#</cfoutput>
		<cfset weridDirectorName= #getDirectorsList.DIR#><!---For some reason the code will not take the UUID for the TBODY name like the other tables--->
		<input type="button" onclick="ToggleRowDisplay(this,'#weridDirectorName#')" <cfoutput>#buttonValueDIR#</cfoutput> name="btnToggle" style="width:20;"></TD>
         <!---OWNER--->
		<TD>#getDir.OWNER_RECD#</TD>
		<TD>#getDir.OWNER_OPEN#</TD>
		<TD>#getDir.OWNER_COMPLETE#</TD>
		<TD>#getDir.OWNER_PASTDUE#</TD>
		<TD>#getDir.OWNER_AGING#</TD>
		<!---REMOTE --->
		<TD>#getDir.REMOTE_RECD#</TD>
		<TD>#getDir.REMOTE_OPEN#</TD>
		<TD>#getDir.REMOTE_COMPLETE#</TD>
		<TD>#getDir.REMOTE_PASTDUE#</TD>
		<TD>#getDir.REMOTE_AGING#</TD>
		<!---CENT--->
		<TD>#getDir.CENT_RECD#</TD>
		<TD>#getDir.CENT_OPEN#</TD>
		<TD>#getDir.CENT_COMPLETE#</TD>
		<TD>#getDir.CENT_PASTDUE#</TD>
		<TD>#getDir.CENT_AGING#</TD>       
      </TR>
 	
      <!---Grab ADSS--->
	<cfset go_ADSS_List = adssList(#getDirectorsList.DIR#)>
	<tbody id="#weridDirectorName#"  <cfoutput>#loadHideShowDir#</cfoutput>><!---TBODY FOR DIR--->
	<cfloop query="getAdssList">
        <cfset goADS= processADSS(#getAdssList.ADSS#)>
		<TR  class="adssRow"  id="adssRow">
		  <TD align="center"><cfset adssName = getLastName(#getAdssList.ADSS#)> <cfoutput>#adssName#</cfoutput>
		<input type="button" onclick="ToggleRowDisplay(this,'#getAdssList.ADSS#')" <cfoutput>#buttonValueADSS#</cfoutput> name="btnToggle" style="width:20;"></TD>
    		<!---OWNER--->
			<TD>#getADSS.OWNER_RECD#</TD>
			<TD>#getADSS.OWNER_OPEN#</TD>
			<TD>#getADSS.OWNER_COMPLETE#</TD>
			<TD>#getADSS.OWNER_PASTDUE#</TD>
			<TD>#getADSS.OWNER_AGING#</TD>
			<!---REMOTE --->
			<TD>#getADSS.REMOTE_RECD#</TD>
			<TD>#getADSS.REMOTE_OPEN#</TD>
			<TD>#getADSS.REMOTE_COMPLETE#</TD>
			<TD>#getADSS.REMOTE_PASTDUE#</TD>
			<TD>#getADSS.REMOTE_AGING#</TD>
			<!---CENT--->
			<TD>#getADSS.CENT_RECD#</TD>
			<TD>#getADSS.CENT_OPEN#</TD>
			<TD>#getADSS.CENT_COMPLETE#</TD>
			<TD>#getADSS.CENT_PASTDUE#</TD>
			<TD>#getADSS.CENT_AGING#</TD>   
        </TR>
		
        <!---Grab ADSS CSS--->
        <cfset go_ADSS_CSS_List = adssCssList(#getAdssList.ADSS#)>
        <tbody id="#getAdssList.ADSS#" <cfoutput>#loadHideShowADSS#</cfoutput>><!---TBody For Adss--->
		<cfoutput>ADS:          #getAdssList.ADSS#</cfoutput>
			<!---CSS--->
			<cfloop query="getAdssCssList">
			<cfset goAdssCss = processCss(#getAdssCssList.PMT_USER_ID#)>
			  <TR class="cssRow" id="cssRow">
				<TD align="right"><cfset CSS_1_Name = getLastName(#getAdssCssList.PMT_USER_ID#)> <cfoutput>#CSS_1_Name#</cfoutput></TD>
				<!---OWNER--->
				<TD>#getCss.OWNER_RECD#</TD>
				<TD>#getCss.OWNER_OPEN#</TD>
				<TD>#getCss.OWNER_COMPLETE#</TD>
				<TD>#getCss.OWNER_PASTDUE#</TD>
				<TD>#getCss.OWNER_AGING#</TD>
				<!---REMOTE --->
				<TD>#getCss.REMOTE_RECD#</TD>
				<TD>#getCss.REMOTE_OPEN#</TD>
				<TD>#getCss.REMOTE_COMPLETE#</TD>
				<TD>#getCss.REMOTE_PASTDUE#</TD>
				<TD>#getCss.REMOTE_AGING#</TD>
				<!---CENT--->
				<TD>#getCss.CENT_RECD#</TD>
				<TD>#getCss.CENT_OPEN#</TD>
				<TD>#getCss.CENT_COMPLETE#</TD>
				<TD>#getCss.CENT_PASTDUE#</TD>
				<TD>#getCss.CENT_AGING#</TD>       
			  </TR>
			</cfloop>
        			<!---Grab ADSS2--->
			<cfset go_ADSS_2_List = adss2List(#getAdssList.ADSS#)>
			<cfloop query="getAdss2List">
			  <cfset goAdss2 = processADSS_2(#getAdss2List.ADSS_2#)>
			  <TR class="adss2Row" id="adss2Row">
				<TD align="Center"><cfset ADSS_2_Name = getLastName(#getAdss2List.ADSS_2#)> <cfoutput>#ADSS_2_Name#</cfoutput>
				<input type="button" onclick="ToggleRowDisplay(this,'#getAdss2List.ADSS_2#')" <cfoutput>#buttonValueADSS2#</cfoutput> name="btnToggle" style="width:20;"></TD>
					<!---OWNER--->
					<TD>#getADSS_2.OWNER_RECD#</TD>
					<TD>#getADSS_2.OWNER_OPEN#</TD>
					<TD>#getADSS_2.OWNER_COMPLETE#</TD>
					<TD>#getADSS_2.OWNER_PASTDUE#</TD>
					<TD>#getADSS_2.OWNER_AGING#</TD>
					<!---REMOTE --->
					<TD>#getADSS_2.REMOTE_RECD#</TD>
					<TD>#getADSS_2.REMOTE_OPEN#</TD>
					<TD>#getADSS_2.REMOTE_COMPLETE#</TD>
					<TD>#getADSS_2.REMOTE_PASTDUE#</TD>
					<TD>#getADSS_2.REMOTE_AGING#</TD>
					<!---CENT--->
					<TD>#getADSS_2.CENT_RECD#</TD>
					<TD>#getADSS_2.CENT_OPEN#</TD>
					<TD>#getADSS_2.CENT_COMPLETE#</TD>
					<TD>#getADSS_2.CENT_PASTDUE#</TD>
					<TD>#getADSS_2.CENT_AGING#</TD>
			  </TR>
				  <!---Grab ADSS2 CC--->
				  <cfset go_ADSS_2_CSS_List = adss2CssList(#getAdss2List.ADSS_2#)>
				   <tbody id="#getAdss2List.ADSS_2#"  <cfoutput>#loadHideShowADSS2#</cfoutput>><!---TBody For Adss_2--->
				  <cfloop query="getAdss2CssList">
					<cfset goAdssCSS2 = processCSS(#getAdss2CssList.PMT_USER_ID#)>
					<TR class="cssRow" id="cssRow">
						 <TD align="Right"><cfset CSS_2_Name = getLastName(#getAdss2CssList.PMT_USER_ID#)> <cfoutput>#CSS_2_Name#</cfoutput></TD>
						<!---OWNER--->
						<TD>#getCss.OWNER_RECD#</TD>
						<TD>#getCss.OWNER_OPEN#</TD>
						<TD>#getCss.OWNER_COMPLETE#</TD>
						<TD>#getCss.OWNER_PASTDUE#</TD>
						<TD>#getCss.OWNER_AGING#</TD>
						<!---REMOTE --->
						<TD>#getCss.REMOTE_RECD#</TD>
						<TD>#getCss.REMOTE_OPEN#</TD>
						<TD>#getCss.REMOTE_COMPLETE#</TD>
						<TD>#getCss.REMOTE_PASTDUE#</TD>
						<TD>#getCss.REMOTE_AGING#</TD>
						<!---CENT--->
						<TD>#getCss.CENT_RECD#</TD>
						<TD>#getCss.CENT_OPEN#</TD>
						<TD>#getCss.CENT_COMPLETE#</TD>
						<TD>#getCss.CENT_PASTDUE#</TD>
						<TD>#getCss.CENT_AGING#</TD>
					</TR>
				  </cfloop><!---Css2 2 Loop--->
				  </tbody> <!---ADSS2 Tbody closing Tag--->
			</cfloop><!--- ADSS 2 Loop--->
		</tbody><!---ADSS Tbody closing Tag--->		
	</cfloop><!---ADSS Loop--->
	</tbody><!---Dir   Tbody closing Tag--->
</cfloop><!---Dir Loop--->

Open in new window

Comment
Watch Question

Software Engineer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
James RodgersWeb Applications Developer
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
THANKS!!!
HonorGodSoftware Engineer
CERTIFIED EXPERT

Commented:
You're welcome.  Thanks for the grade.  Good luck.
James RodgersWeb Applications Developer
CERTIFIED EXPERT

Commented:
glad i could help

thanks for the points
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.