scripter73
Programmer
Hi,
My goal is to allow user to click on a link (preferably the Field Name Header), and have that data "re-sorted" based on the user's request.
Is this something that can be done using Cold Fusion (without <cfgrid>)or will I have to resort to another tool like Javascript.
Example. My data will already be presented in a sorted format, but if the user wanted to change it to sort by date, etc.
Below is a sample of my table that I'd like to sort:
<!--- Beginning of Data Table --->
<table width=800 border=0>
<tr bgcolor="6699cc">
<td width=10><font size=3 color=black>Binder#</font></td>
<td width=10><font size=3 color=black>Tran Date</font></td>
<td width=10><font size=3 color=black>Agent Code</font></td>
<td width=40><font size=3 color=black>Insured Name</font></td>
<td width=10><font size=3 color=black>Account#</font></td>
<td width=200><font size=3 color=black>Bank Amount</font></td>
</tr>
<cfset #grand_total# = 0>
<cfoutput query="achdata">
<cfif (#achdata.currentrow# mod 2) eq 0>
<tr bgcolor="6699CC" width=800>
<cfelse>
<tr bgcolor="ffffff" width=800>
</cfif>
<td width=10>#wach_binder_number#</td>
<td width=10>#wach_tran_date#</td>
<td width=10>#wach_agent_code#</td>
<!--- If there's a middle initial, display it. If not, then don't display anything. --->
<cfif #wach_ins_middle_initial# neq "" and #wach_ins_middle_initial# neq " ">
<td width=40>#wach_ins_last_name#, #wach_ins_first_name#, #wach_ins_middle_initial#</td>
<cfelse>
<td width=40>#wach_ins_last_name#, #wach_ins_first_name#</td>
</cfif>
<td width=10>#wach_bank_account_num#</td>
<td width=200>#wach_bank_amount#</td>
<cfset #grand_total# = #grand_total# + #wach_bank_amount#>
</cfoutput>
</tr>
<tr width=800>
<td width=400></td>
<td width=400 align="right" colspan=5><cfoutput>Grand Total is #grand_total#.</cfoutput></td>
</tr>
</table>
<!--- End of Data Table --->
Thanks in advance,
scripter73
My goal is to allow user to click on a link (preferably the Field Name Header), and have that data "re-sorted" based on the user's request.
Is this something that can be done using Cold Fusion (without <cfgrid>)or will I have to resort to another tool like Javascript.
Example. My data will already be presented in a sorted format, but if the user wanted to change it to sort by date, etc.
Below is a sample of my table that I'd like to sort:
<!--- Beginning of Data Table --->
<table width=800 border=0>
<tr bgcolor="6699cc">
<td width=10><font size=3 color=black>Binder#</font></td>
<td width=10><font size=3 color=black>Tran Date</font></td>
<td width=10><font size=3 color=black>Agent Code</font></td>
<td width=40><font size=3 color=black>Insured Name</font></td>
<td width=10><font size=3 color=black>Account#</font></td>
<td width=200><font size=3 color=black>Bank Amount</font></td>
</tr>
<cfset #grand_total# = 0>
<cfoutput query="achdata">
<cfif (#achdata.currentrow# mod 2) eq 0>
<tr bgcolor="6699CC" width=800>
<cfelse>
<tr bgcolor="ffffff" width=800>
</cfif>
<td width=10>#wach_binder_number#</td>
<td width=10>#wach_tran_date#</td>
<td width=10>#wach_agent_code#</td>
<!--- If there's a middle initial, display it. If not, then don't display anything. --->
<cfif #wach_ins_middle_initial# neq "" and #wach_ins_middle_initial# neq " ">
<td width=40>#wach_ins_last_name#, #wach_ins_first_name#, #wach_ins_middle_initial#</td>
<cfelse>
<td width=40>#wach_ins_last_name#, #wach_ins_first_name#</td>
</cfif>
<td width=10>#wach_bank_account_num#</td>
<td width=200>#wach_bank_amount#</td>
<cfset #grand_total# = #grand_total# + #wach_bank_amount#>
</cfoutput>
</tr>
<tr width=800>
<td width=400></td>
<td width=400 align="right" colspan=5><cfoutput>Grand Total is #grand_total#.</cfoutput></td>
</tr>
</table>
<!--- End of Data Table --->
Thanks in advance,
scripter73