Thanks for the reply. However, there’s still a problem.
I do the following in my getNodes.php:
$node = new TreeNode();
// Setup the popup menu that allows for updating or deleting
$node->menu = array('items' => array());
$node->menu['items'][] = array('text' => 'Update','handler' => 'function(itm,e) { this.updateTariff(itm,e); }',);
$node->menu['items'][] = '-';
$node->menu['items'][] = array('text' => 'Remove','handler' => 'function(itm,e) { this.removeTariff(itm,e); }',);
It’s basically the same thing as you do in your Gallery app. Only difference is that you transform your Album directly into an array while I use a TreeNode class to hold the data for the tree. Reason for this is my nodes at various levels are not of the same class as you have in your app.
Now when I use toJSON() I get a Javascript exception:
Uncaught SyntaxError: Unexpected token )
Any ideas?