extJS tree control not populating anymore???
Posted: Thu Dec 17, 2009 7:03 pm
This code was working and now for whatever reason it's stopped:
The JSON script returns the following code which is to my knowledge, correct:
Does anyone have any ideas as to what the **** is going on? It worked before and as far as I remember I haven't changed anything in this code to make it choke like this -- I have cleared my cache and used FireBug to try and diagnose with no luck???
Here is the HTML apparently I cannot upload HTML or TXT files???
Please note the pcspectra.com domain is for a local setup and will not work for you, so ignore that. 
Cheers,
Alex
The JSON script returns the following code which is to my knowledge, correct:
Code: Select all
[{"id":69,"leaf":false,"text":"Root","children":[{"id":2,"leaf":false,"text":"Child","children":[{"id":3,"leaf":true,"text":"Sub-Child One"},{"id":4,"leaf":true,"text":"Sub-Child Two"}]}]}]Here is the HTML apparently I cannot upload HTML or TXT files???
Code: Select all
<html> <head> <base href="http://www.pcspectra.com/admin/" /> <title>SpectraPage :: Page Management System</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css"> <script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext/ext-all-debug.js"></script> <script type="text/javascript"> // SpectraPage application module (should be refactored into a JS file) Ext.ns('SpectraPage'); SpectraPage.app = function(){ return{ init: function() { var Tree = Ext.tree; var tree = new Tree.TreePanel({ region: 'west', title: 'Site Page Structure', split: true, lines: true, width: '30%', minSize: 175, collapsible: true, margins:'5 0 5 5', //cmargins:'35 5 5 5', // Initialize tree control border: true, autoScroll: true, animate: true, enableDD: true, containerScroll: true, loader: new Tree.TreeLoader({ dataUrl: 'http://www.pcspectra.com/admin/system/application/page/?action=tree' }), // Initialize root node of tree root: new Tree.AsyncTreeNode({ text: 'pcspectra.com', draggable: false, expanded: true, id: '0' }) }); // Register event listeners to implement interactivity tree.addListener('click', function (node, event){ alert(node.attributes.id+'='+node.attributes.text); }); tree.addListener('movenode', function (tree, node, oldParent, newParent, index){ alert('moved. Old parent node id='+ oldParent.id+'. new parent node id='+newParent.id); }); tree.getRootNode().expand(true); var viewport = new Ext.Viewport({ layout: "border", renderTo: Ext.getBody(), items: [{ region: "north", xtype: 'panel', contentEl: 'header' },{ region: 'south', xtype: 'panel', contentEl: 'footer' },{ region: 'center', xtype: 'panel', html: 'This will be replaced by web page content and utilities' }, tree] }); } }; }(); // SpectraPage initialization Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif'; Ext.onReady(SpectraPage.app.init, SpectraPage); </script> </head> <body> <div id="header"> <div> <img src="" style="width: 110px; height: 45px; vertical-align: middle" hspace="2" vspace="2" /> <a href="">Pages | Blogs | Articles | Forums</a> </div> </div> <div id="footer" style="text-align: center; height: 35px; background-color: #eaeaea"> This is the footer and copyright information </div> </body></html>Cheers,
Alex