Array of Structs in cftree
Hi,
I am using an array of structs to populate the data in a cftree and cfloop query to fill the structs, this worked well initially, but as the data is increasing, it gets slower and slower, is there a solution for this ?
<cfcomponent name="treeComp">
<cffunction name=mytree>
<cfargument name="path" required="Yes">
<cfargument name="value" required="Yes">
<cfset result = arrayNew(1)>
<cfquery datasource="source" name="entries">
SELECT value, name FROM data
</cfquery>
<cfloop query="entries">
<cfset item=StructNew()>
<cfset item.value=entries.value>
<cfset item.display=entries.name>
<cfset arrayappend(result,item)>
</cfloop>
<cfreturn result>
</cffunction>
</cfcomponent>
tree.cfm
-----------
<cfform>
<cftree name="tree" format="html">
<cftreeitem bind="cfc:treeComp.mytree({cftreeItemPath},{cftreeItemValue})">
</cftree>
