imstillatwork
IS-IT--Management
stDocCat is from tblDocManCat (Fields "Cat"(text) and "CatID"(autonum))
When I loop the structure below(stDocCat), I want to output to be sorted by "cat". As it is now, output is sorted by CatID, so my output is not alphabetical.
Do i need to use an array to be able to sort this properly?
The structure takes the index to output the
So what I want, is, that the output of the cfloop is sorted by "cat", not "catID".
as it is, it is not friendly to the eye. I want the output to be alphabetical.
any ideas?
I may not be explaining it good, if you email me, I may be able to allow you to view what I am working on.
Kevin
Below is my code.
<!---
======================
== ARTICLE MENU ==
======================
--->
<cfif isDefined("attributes.catID"
>
<cfquery name="getdoclist" datasource="intranet">
SELECT *
FROM tblDocMan
WHERE tblDocMan.CatID = #attributes.CatID#
AND tblDocMan.typeID = #attributes.Type#
ORDER BY title ASC
</cfquery>
</cfif>
<!---Use Structure in Application.cfm--->
<cfloop collection="#stDocCat#" item="index">
<cfoutput>
<br> <a href="/index.cfm?loc=docs&docact=list&type=#attributes.type#&catID=#index#">#stDocCat[index]#</a>
</cfoutput>
<cfif isDefined("attributes.catID"
>
<cfif attributes.catID eq #index#>
<span class="bold">:.</span>
<cfif getdoclist.recordcount eq 0>
<br> <b>:</b> there is nothing here
<cfelse>
<cfoutput query="getdoclist">
<br> <b>:</b> <a href="/index.cfm?loc=docs&type=#attributes.type#&docact=view&CatID=#attributes.catID#&DocID=#docID#"><span class="docmenu">#Title#</span></a>
</cfoutput>
<br>
</cfif>
</cfif>
</cfif>
</cfloop> IF YOU DON'T KNOW HOW A TAG WORKS...
...DOWNLOAD THE CFML REFERENCE!
When I loop the structure below(stDocCat), I want to output to be sorted by "cat". As it is now, output is sorted by CatID, so my output is not alphabetical.
Do i need to use an array to be able to sort this properly?
The structure takes the index to output the
So what I want, is, that the output of the cfloop is sorted by "cat", not "catID".
as it is, it is not friendly to the eye. I want the output to be alphabetical.
any ideas?
I may not be explaining it good, if you email me, I may be able to allow you to view what I am working on.
Kevin
Below is my code.
<!---
======================
== ARTICLE MENU ==
======================
--->
<cfif isDefined("attributes.catID"

<cfquery name="getdoclist" datasource="intranet">
SELECT *
FROM tblDocMan
WHERE tblDocMan.CatID = #attributes.CatID#
AND tblDocMan.typeID = #attributes.Type#
ORDER BY title ASC
</cfquery>
</cfif>
<!---Use Structure in Application.cfm--->
<cfloop collection="#stDocCat#" item="index">
<cfoutput>
<br> <a href="/index.cfm?loc=docs&docact=list&type=#attributes.type#&catID=#index#">#stDocCat[index]#</a>
</cfoutput>
<cfif isDefined("attributes.catID"

<cfif attributes.catID eq #index#>
<span class="bold">:.</span>
<cfif getdoclist.recordcount eq 0>
<br> <b>:</b> there is nothing here
<cfelse>
<cfoutput query="getdoclist">
<br> <b>:</b> <a href="/index.cfm?loc=docs&type=#attributes.type#&docact=view&CatID=#attributes.catID#&DocID=#docID#"><span class="docmenu">#Title#</span></a>
</cfoutput>
<br>
</cfif>
</cfif>
</cfif>
</cfloop> IF YOU DON'T KNOW HOW A TAG WORKS...
...DOWNLOAD THE CFML REFERENCE!