sffdfasddsadf
Below is the code for the page region containing the tree.Notice that I declare tree array in the page region and not the template.This allows me to keep the list template generic and reuse it for all my tree lists.View the page source to see the actual output of the template.
<script type="text/javascript"> var tree#REGION_ID# = [
]; Ext.onReady(function(){ // show the same list in a window var win = new Ext.Window({ title: 'Tree Panel Window' ,closable:true ,border:false ,plain:true ,layout: 'fit' ,items:new Ext.tree.TreePanel({ loader:new Ext.tree.TreeLoader() ,width:200 ,height:400 ,autoScroll: true ,root:new Ext.tree.AsyncTreeNode({ leaf:false ,loaded:false ,expanded:true ,text:'Tree Root' ,children:tree#REGION_ID# }) }) }).show(this); }); </script>
Ext.tree.TreePanel
{id:"#LIST_ITEM_ID#","text":"#TEXT#","href":"#LINK#","leaf":true}
,
]}
{"id":"#LIST_ITEM_ID#","text":"#TEXT#","href":"#LINK#","leaf":true}
{id:"#LIST_ITEM_ID#","text":"#TEXT#","href":"#LINK#","leaf":false,"children": [
{"id":"#LIST_ITEM_ID#","text":"#TEXT#","href":"#LINK#","leaf":false,"children": [
Mark Lancaster 13-NOV-2008 -------------------------- Developers must ensure list is JSON escaped.