Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

(Help please) Adding an ad icon to my parent and child list

Hi,

I have a parent and child list that I need to add an (ad icon) to the list.

the output should look just like in the image.  If the record is a child the ad icon should be added to the end of the list. If the record is a parent the ad icon should be added right after it.  

I need your help please.

Thanks,
Lulu



<cfif val(QSearchResult.ParentIssueID)> 
 <!-- //Child Row -->
 <tr class="bg2row">
   <td style="padding-left:20px;">#QSearchResult.issueID#</td>
 <td>#QSearchResult.ticketNumber#</td>
 <td>#QSearchResult.Category#</td>
 <td>#QSearchResult.TitleOfIssue#</td>
 <td>#QSearchResult.Status#</td>
  <td>#DateFormat(QSearchResult.DateCreated, "m/d/yyyy")#</td>
    <td><a href="LogEntry.cfm?EID=#QSearchResult.issueID#"><img src="images/edit.png" alt="Edit Sub Issue" /></a>
    <img src="images/view.png" alt="View Sub Issue" />
    </td>
    </tr>  
 <cfelse>
<!-- //Parent Row -->
 <tr class="bgrow">
   <td style="font-weight:bold;padding-left:5px;">#QSearchResult.issueID#</td>
 <td style="font-weight:bold;">#QSearchResult.TicketNumber#</td>
 <td style="font-weight:bold;">#QSearchResult.Category#</td>
 <td style="font-weight:bold;">#QSearchResult.TitleOfIssue#</td>
 <td style="font-weight:bold;">#QSearchResult.Status#</td>
  <td style="font-weight:bold;">#DateFormat(QSearchResult.DateCreated, "m/d/yyyy")#</td>
  <td style="color:dark blue;"><a href="LogEntry.cfm?EID=#QSearchResult.issueID#"><img src="images/edit.png" alt="Edit Sub Issue" /></a>
  <img src="images/view.png" alt="View Sub Issue" />
  </td>
  </tr>
  
 </cfif>

Open in new window




 <tr class="bg2row">
    <td colspan="6" style="text-align:right;">
      <a href="LogEntry.cfm?AID=#QSearchResult.ParentIssueID#"><img src="images/add.png" alt="Add Sub Issue" /></a>
    </td>
    <td>
    </td>
    </tr>

Open in new window


User generated image
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As a side note, I also think the page would look good if you just place the icon on the same line as the parent (with the other two icons).   That would save you a lot of rows that are there just for the Add icon.   BUt that's up to you and your clients... just my 2 cents.
Avatar of lulu50

ASKER

gdemaria,

I made the changes but, I only able to have one add in one of the parents.

Yes, I agree I should not have an extra row for the ad

<cfoutput query="QSearchResult" startrow="#start_record#" maxrows="#records_per_page#">

 <cfif val(QSearchResult.ParentIssueID)> 
 <!-- //Child Row -->
 <tr class="bg2row">
   <td style="padding-left:20px;">#QSearchResult.issueID#</td>
 <td>#QSearchResult.ticketNumber#</td>
 <td>#QSearchResult.Category#</td>
 <td>#QSearchResult.TitleOfIssue#</td>
 <td>#QSearchResult.Status#</td>
  <td>#DateFormat(QSearchResult.DateCreated, "m/d/yyyy")#</td>
    <td><a href="LogEntry.cfm?TechType=#QSearchResult.CategoryTypeID#&ID=#QSearchResult.issueID#"><img src="images/edit.png" alt="Edit Sub Issue" /></a>
    <img src="images/view.png" alt="View Sub Issue" />
    </td>
    </tr>  
 <cfelse>
 <tr class="bgrow">
	 <td style="font-weight:bold;padding-left:5px;">#QSearchResult.issueID#</td>
	 <td style="font-weight:bold;">#QSearchResult.TicketNumber#</td>
	 <td style="font-weight:bold;">#QSearchResult.Category#</td>
	 <td style="font-weight:bold;">#QSearchResult.TitleOfIssue#</td>
	 <td style="font-weight:bold;">#QSearchResult.Status#</td>
	  <td style="font-weight:bold;">#DateFormat(QSearchResult.DateCreated, "m/d/yyyy")#</td>
	  <td style="color:dark blue;"><a href="LogEntry.cfm?EID=#QSearchResult.issueID#"><img src="images/edit.png" alt="Edit Sub Issue" /></a>
	  <img src="images/view.png" alt="View Sub Issue" />
      <cfif QSearchResult.currentRow gt 1 and val(previousParentIssueID)>
      <a href="AddChild.cfm?EID=#previousParentIssueID#"><img src="images/add.png" alt="Add Child" /></a>
      </cfif>
      
	  </td>
  </tr>
</cfif>
<cfset previousParentIssueID = QSearchResult.ParentIssueID> 

 
</cfoutput>

Open in new window




User generated image
Avatar of lulu50

ASKER

I got it!!!!!!!!!!
Avatar of lulu50

ASKER

It's working!!!!!!!!!!!!

this is what I did.

<cfset previousParentIssueID = QSearchResult.ParentIssueID> 
<cfoutput query="QSearchResult" startrow="#start_record#" maxrows="#records_per_page#">

 <cfif val(QSearchResult.ParentIssueID)> 
 <!-- //Child Row -->
 <tr class="bg2row">
   <td style="padding-left:20px;">#QSearchResult.issueID#</td>
 <td>#QSearchResult.ticketNumber#</td>
 <td>#QSearchResult.Category#</td>
 <td>#QSearchResult.TitleOfIssue#</td>
 <td>#QSearchResult.Status#</td>
  <td>#DateFormat(QSearchResult.DateCreated, "m/d/yyyy")#</td>
    <td><a href="LogEntry.cfm?TechType=#QSearchResult.CategoryTypeID#&ID=#QSearchResult.issueID#"><img src="images/edit.png" alt="Edit Sub Issue" /></a>
    <img src="images/view.png" alt="View Sub Issue" />
    </td>
    </tr>  
 <cfelse>
 <tr class="bgrow">
	 <td style="font-weight:bold;padding-left:5px;">#QSearchResult.issueID#</td>
	 <td style="font-weight:bold;">#QSearchResult.TicketNumber#</td>
	 <td style="font-weight:bold;">#QSearchResult.Category#</td>
	 <td style="font-weight:bold;">#QSearchResult.TitleOfIssue#</td>
	 <td style="font-weight:bold;">#QSearchResult.Status#</td>
	  <td style="font-weight:bold;">#DateFormat(QSearchResult.DateCreated, "m/d/yyyy")#</td>
	  <td style="color:dark blue;"><a href="LogEntry.cfm?EID=#QSearchResult.issueID#"><img src="images/edit.png" alt="Edit Sub Issue" /></a>
	  <img src="images/view.png" alt="View Sub Issue" />
                 <cfif not val(previousParentIssueID)>
      <a href="AddChild.cfm?EID=#QSearchResult.issueID#"><img src="images/add.png" alt="Add Child" /></a>
      </cfif>
	  </td>
  </tr>
</cfif>
</cfoutput>

Open in new window



User generated image
Avatar of lulu50

ASKER

Could not have done it without you!!!!!!!!!!!!!!!!!!!

Thank you lol
Avatar of lulu50

ASKER

Excellent+++++
Super, glad it worked!