View Full Version : Loading TreePanel from PHP

16 Feb 2011, 11:35 PM

I'm new to Ext JS and I make my first experiments with a TreePanel. I looked at the tutorials for getting help, especially this one:


I got the tree loading up and running now. It is loaded by my PHP classs. But one thing is annoying me: Above the TreePanel the JSON data is printed, something like:


How can I suppress this output? The last line of my PHP code is this:

echo json_encode($this->nodes);

Any hints? Is the a configuration option that I missed?

Best regards,

21 Feb 2011, 10:28 PM
Does really noone has an idea, how to suppress this output of the tree data? Is there any debug output enabled by default?

Best regards,

22 Feb 2011, 4:18 AM
You should check from where you get that output. Are you sure you aren't calling the php file before loading the trtee or smth like that? check with firebug and see in what dom element that output is set. I doubt it's inside an ext dom created element.

Here's my code, it works ok.

var tree = new Ext.tree.TreePanel({
useArrows: true,
autoScroll: true,
animate: true,
containerScroll: true,
border: false,
dataUrl: '/urlGoesHere',
root: {
nodeType: 'async',
text: 'Root Node'
rootVisible: false

22 Feb 2011, 4:29 AM
You are right. There was a call to the PHP file before building the tree. After removing this everything works fine.