Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 07, 2007 10:08
open dhtmlx forum
Do you have an example of how I would need to write the code if I were using Cold Fusion to read from a ...

Do you have an example of how I would need to write the code if I were using Cold Fusion to read from a database?  How would it create an xml formated output?
Answer posted on Mar 07, 2007 10:08

<?xml version='1.0' encoding='utf-8'?>

<cfcontent type="text/xml">

<cfsetting enablecfoutputonly="Yes">

<cfquery name=“yourQuery“...>

Select id, name from …

</cfquery>

<cfoutput>

<tree id=“0“>

<cfloop query=“yourQuery“>

            <item id=“#id#“ text=“#name#“>

                        <cfinclude template=”sdfdsfsd.cfm”><!--- you can call same template with id of parent node (#id#) as attribute and output nested items there. But in this case you need to skip <?xml and <tree tags for nested levels (if id attribute was specified)

            </item>           

</cfloop>

</cfoutput>

Answer posted by Embre (Support) on Dec 11, 2014 12:14

Not much can be said in addition to the reply above, but you also can check editor dhtml and javascript weekly calendar and find out what we have probably missed in our explanation.