Unordered List from CFQUERY
Another great advantage is the use of cfquery results for DBTree. Just use the attribute "query"
to define the query results you want to use.
Query results work for all types of DBTree output functions except the type
"path" for breadcrumb trails.
A quite important
thing is that you should write "..ORDER BY sortorder ASC.." in your SQL query
to have your Tree sorting order unchanged.
You might as well use this functionality to create dropdown menus for different users dependent upon their user rights..
Sample Code
<cfquery name="myquery" datasource="dsn" username="username" password="password"> select * from table where parent_id=0 or parent_id=6 order by sortorder asc </cfquery> <cf_dbtree instancename="id for the list" query="myquery" action="get" type="linked" url_type="db" url="column name" id="column name" parent="column name" contentfield="column name" titlefield="column name">
Result
Search
Add Comment
Join for a free account, or login if you are already a member.
