Skip to main content

dojo api like tree component

1 reply [Last post]
Joined: 2006-08-14
Points: 0

I was just looking at the dojo api reference at and the right side has methods with a tree like plus next to them. But the contents are not other nodes, they are content pains that expand and contract.

Is this possible with any of the jMaki components?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-07-31
Points: 0

Add a tree to your page. I suggest putting it in a sidebar. Here is the tree I'm using:

'root':{'title': 'Default Tree Root Node',
'expanded': true,
'children': [
{'title':'Node 1.1', 'onclick': {'url':'foo.jsp'}},
{'title':'Node 1.2',
'children': [
{'title':'Node 3.1', 'onclick': {'url':'foo2.jsp'}}
}" />

Now add a jMaki dynamic container to another region of the page. I suggest the content area. The dcontainer needs to be in a sized container (something where the CSS height and width is set).

Add a jmaki.dcontainer widget as follows:

Add the following to your jMaki glue.js file:

jmaki.addGlueListener({'topic' : '/dojo/tree',
'action': 'call',
'target': {
'object': 'jmaki.listeners',
'functionName': 'handleTree'

jmaki.listeners.handleTree = function(args) {
jmaki.publish("/jmaki/mycontainer", args.url);

Now when you double click on a sub node the dynamic container will load the page associated with the url you used on the tree.

You will need more pages to represent what was loaded (or a servlet/jsp to generate what the url needs).

Let me know if this doesn't work.