"What if? Why not? Challenge the Convention! Let's do some incredible things!"  More Quotes

Welcome to Aspire Knowledge Central (AKC)

   Home   Public Library   Author Content

Choose a data format:   classic-xml   object-xml   embedded-xml   text   excel

laszlo: Getting your feet wet Example 2: A Dynamic tree

Click here to provide feedback or comments at the bottom of this page

Designing a dynamic tree


<canvas height="620">
<include href="lz/tree.lzx"/>
 <dataset type="http" name="foldersDataSet" 
    request="true"
    src="http://localhost:8181//akc/display"
   querystring="url=abc&ownerUserId=xyz&aspire_output_format=object-xml"/>

<!--
************************************************
* Simple working tree
************************************************
-->   
<simplelayout axis="x" spacing="200"/>
<window width="200" title="Sample simple tree">
     <view width="200" height="200">
      <tree open="true" text="valuemeal">
        <tree text="fries" isleaf="true"/>
        <tree open="true" text="drink">
          <tree text="cola" isleaf="true"/>
        </tree>
        <tree open="true" text="burger">
          <tree text="patty" isleaf="true"/>
          <tree text="lettuce" isleaf="true"/>
          <tree text="onions" isleaf="true"/>
          <tree text="buns" isleaf="true"/>
        </tree>
      </tree>
    </view>
</window>

<!--
************************************************
* A first cut at a dynamic tree
************************************************
-->   
<window width="200" x="210">
   <view width="200" height="200">
      <simplelayout axis="y" spacing="10"/>
      <tree datapath="foldersDataSet:/AspireDataSet/FoldersLoop1" 
            text="CCP Folders" icon="null" 
            showroot="false" 
            onselected="canvas.myalert.open()">
            
         <tree  datapath="*" text="$path{'folder_name/text()'}" recurse="false">
            <method event="onopen">
               canvas.myalert.setAttribute('text', this.text);
               canvas.myalert.open();
            </method>
         </tree>
         </tree>
     </view>
</window>

<!--
************************************************
* A small attempt at a workable alert
************************************************
-->   
<alert name="myalert" width="100" y="330">
   hi
</alert>

<!--
************************************************
* Testing the alert
************************************************
-->   
<button y="300" onclick="canvas.myalert.open()">Show Alert</button>

<method name="hi">
   canvas.myalert.open();
</method>
</canvas>

Subject (Don't use any html tags)

Description (Use html tags: h3, h4, p, pre, a, etc.)

Name Email