Login Register

tree

construct tree from database information dynamically

Hi master,

I have a problem to retrieve information from database to construct a tree. Below is my code which point to physical file to construct a tree and it works fine. I have construct a json format with javascirpt and it works when i pasted the information into the file that i harded.[URL parameter was hard coded to that particular json file]. How can i constructe a tree dynamically with database information.

javascript
var jsonForm = "{identifier: 'packageID',label: 'packageName',items:"+getJsonAcc1+"}";

JSP

Add new item to a parent pointed by other items

I am using the example "test_Tree_Notification_API_Support.html" and trying to add a new item to a parent which other items point to.
In the example,
root
- node1
-- node1.1
-- node1.2
- node2
- node3
- node4
- node5

So, I add "node1" to node5. Now, it becomes
root
- node1
-- node1.1
-- node1.2
- node2
- node3
- node4
- node5
-- node1
--- node1.1
--- node1.2

Then, I add a new node "node1.1.1" to "node1.1"
It becomes
root
- node1
-- node1.1
-- node1.2
- node2
- node3
- node4
- node5
-- node1
--- node1.1
---- node1.1.1
--- node1.2

Tree Onclick method

Hi

The tree's Onclick method is not working in IE6. but is working in FF2
when the tree is in an accordion pane which is in a contentpane of a tab container.

Please help

Dino

Tree DND Handle support

I'm trying to programmatically create a nested list of items (for my purposes a maximum of three deep), where only the leaf nodes are drag-able.

So far, I've tried using nested dijit.TitlePanes with multiple dojo.dnd.Sources, however this gets slower the more dojo.dnd.Sources you have (somewhere around 50 or so it becomes unbearable on a fairly decent system).

I took a look at the tree structure, but it looks like the idea of "Handles" was removed from the DND surrounding them, and wasn't able to find a good way to inhibit the dragging of non-leaf nodes.

Add paging to a dijit.tree

I am in the process of creating a JSP page that allows a user to search for something. When they click search, I load a tree to display the results. The tree shows offices as the parent nodes and brokers as the children. Since their could be as many as 200 children, part of our requirements are to add paging.

  1. Is it possible to add paging to a nested tree?
  2. Or is it possible to iterate through the store (ItemFileWriteStrore) and split it that way?

The code for displaying the tree is below:

Tree widget: when a parent node becomes a child node of its son

Using Dnd feature in tree, you can experience what happens if you drag a parent node and drop it on any of its child nodes:
the parent node and the child node suddenly disappears from the view!

here is what happens in dijit/tests/tree/test_Tree_DnD.html:
treePic.jpg

The explanation simply is we just created an isolated subtree:

Problems updating multiple Trees with ItemFileWriteStore

Hello all:

I'm pretty new to Dojo, and I'm really impressed with it so far. I've run into a small snag with the Tree widgit though, and was wondering if I'm doing something wrong, or if I've found a bug.

I have an ItemFileWriteStore, reading JSON data from my server. There are two types within this data: 'folders', and 'items'. As you might suspect, an 'item' resides within a folder.

I have two trees. The first tree displays folders, and the item children of the folders. The second tree displays all items.

Selecting tree node programmatically: Works in IE, buggy in Firefox

Hello,

I have a simple tree (2 levels), created in html like so:

<div dojotype="dijit.Tree" id="myTree" label="Top" openonclick="true" store="menuStore">

I want to select a node programmatically, and have the tree open to it, as if the user had clicked it. If the target node is in a closed folder, open it first (this is simplified by way of example - it assumes the target is one level down from a top-level node):

var tree = dijit.byId('myTree');
var menuStore = tree.store;

Adding items to programatically created tree

Hi all,

I have an xml dom from which i create an ItemFileWriteStore datastore, which I use as the Store for my Tree, which i also programatically create like so

var tree = new dijit.Tree({
                                        persist:false,
                                        store: store,
                                        id: "myTree"
                                }, this.dojo.byId("myDivInsideMyContentPane");

inside a ContentPane. So far so good, the Tree displays all the Items as Nodes correctly.

Now I add an Item to the root of my Store like so

dijit.Tree 1.1 drag and drop - possible to specify controller at the node level?

From what I can see the Tree widget is 'all or nothing' when it comes to drag and drop, i.e. you specify a dndController at the Tree level, when specified, the Tree has dnd capabilities.
Is it possible/planned to allow different dnd behaviours at the node level?
To explain:

Syndicate content