Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Driving HTML Outline Output
Message
De
24/07/2005 21:08:12
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
24/07/2005 20:50:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01035579
Message ID:
01035580
Vues:
15
I have never done this before, but the "ParentId" column that points to the parent PK seems the perfect approach. IIRC, that is the way the TreeView sample that comes with VFP 6 works. I didn't look at TreeView samples after that.

As for generating the code, recursion will probably work perfectly. The pseudocode might look more or less like this:
Write starting tags (pre)
Write_The_List (for the top level of the hierarchy)
Write ending tags

FUNCTION Write_The_List
  SCAN (for each element at the selected branch)
    Write the LI code, the text, and the /LI code
    IF there are sub elements
      Write_The_List (for the selected elements)
    ENDIF
  ENDSCAN
ENDFUNC
HTH,

Hilmar.

>I would like to use a VFP table and data drive HTML output that creates an outline style output. That is I want to use the
    or ordered list and
  1. HTML tags to display the results.
    >
    >Here is some sample HTML code to examine:
    >
    >
    > <ol>
    >  <li>Top Level
    >   <ol>
    >    <li>Sub-Level
    >     <ol>
    >      <li>Sub-Level Item 1</li>
    >      <li>Sub-Level Item 2</li>
    >      <li>Sub-Level Item 3
    >       <ol>
    >        <li>Sub-Sub-Level Output</li>
    >       </ol>
    >      </li>
    >     </ol>
    >    </li>
    >
    >
    >As you can see, an order list can go several layers deep. It gets tricky to write a program that can generate this output since Sub-Level Item 3, Sub-Level and Top Level areas do not close their respective tags until after the subordinate tags are complete. However, other tags such as Sub-Level Item 1 and 2 close their tags immediately.
    >
    >Anyone done something like this before? How would you set up the table properly to handle the variable ident level tags? Does something like a parentFK column that points back to its parent PK sound right?
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform