0 Replies Latest reply on May 10, 2006 7:02 AM by rambo

    Using CFTree Problems

    rambo
      I have the following query and am trying to show the results using CFTREE. The data in the database is stored hierarchical and that is how I want them displayed using CFTREE.

      However at present it is only displaying the top level ? how could the following queries be used so that all nodes are displayed in CFTREE?

      <cfquery name="pull_cat" datasource="8">
      Select catno, category
      From pmenu
      Where parent_level = 0
      Order by category
      </cfquery>

      <cfquery name="pull_sub_cat" datasource="8">
      Select catno, category, parent_level
      From pmenu
      Where parent_level is not null
      Order by parent_level, category
      </cfquery>


      <cfform format="flash">
      <CFTREE name="sample"
      height="400"
      width="300">

      <cftreeitem query="pull_cat"
      value="catno,category"
      display="category, category" >
      </cftree>

      </cfform>

      TABLE STRUCTURE
      I.E.
      CATNO, CATEGORY, PARENT_LEVEL
      0 , Root
      1, Menu Item 1, 0
      1.1, Sub Menu Item 1, 1
      1.2, Sub Menu Item 2, 1
      2, Menu Item 2, 0
      2.1, Sub Menu Item 1, 2

      etc.............