0 Replies Latest reply on May 3, 2010 11:28 AM by codymwh

    Building Flex Tree Control w/ Pre-populated SQLite Database

    codymwh

      Hi everyone,

       

      Over the past couple weeks, I've been hunting down a solution for this but have had no luck finding what I need.  Essentially, I have a Flex app (deployed with AIR) that contains a very basic SQLite database.  One of the tables, t_sections, is an inheritance based table with the following columns:

       

      • sectionid
      • parentid
      • sectiontitle

       

      I would like to output the data of this table to a tree control.  The structure of the table, I think, is relatively common.  If parentid is null, or set to zero, it is a root node in the tree control.  Otherwise, if the parentid is declared, it is the child of the sectionid identified in the parentid column.  Below is a quick example:

       

      SectionIDParentIDSection Title
      1NULLSection A
      21Section A1
      3NULLSection B
      43Section B1
      54Section B1a
      64Section B1b
      73Section B2
      83Section B3

       

      So, this tree control would roughly resemble the following:

       

      - Section A

      ----- Section A1

      - Section B

      ----- Section B1

      ---------- Section B1a

      ---------- Section B1b

      ----- Section B2

      ----- Section B3

       

      This tree does not need to have CRUD controls (not in the project scope, yet) as the database will be delivered pre-populated.  Any suggestions, links, or example code would be very appreciated.

       

      Thank you for taking the time to read,

      Cody R.