tree
tree widget
Posted August 8th, 2008 by reddysampathkhi, we have a requirement to build tree and give the user option to change the name of the node, upload a new image for a node, add a node, delete a node and re-order nodes. After making all these changes, the data has to be persisted to relational database. Does any one know if DOJO has any APIs to provide the manipulated data and how it can be transferred to relational database.
Any help or links that provide information is really appreciated.
-Sampath
programmatically created tree doesn't show up in IE7 - FF works fine
Posted March 17th, 2008 by stiggiI have a problem with a dynamic created tree.
First I want to decribe the background:
I am using Dojo v.1.0.2. The tree is created dynamically, the data is hold by an ItemFileReadStore. So, the mainpage loads content via rawXhrPost, the Javascript is extracted from the response and executed. There are four ItemFileReadStores which were built.
So, depending on a navigation item the tree is created dynamically with one of the four stores.
The Problem: it doesn't show up in IE7. It works fine in Firefox. IE7 seems to need a lot of time to build the tree.
The Stores are correct formatted (i.e. no "," at the end) - there are no errors in IE7.
My code:if (dijit.byId("tree")) {
dijit.byId("tree").destroy();
}
}
function changetree( storeName ) {
destroyTree();
var newStore = dojo.getObject(storeName);
if (!newStore) {alert('No Store!');}else {
var newTree = new dijit.Tree( {
store:newStore,
getLabelClass:getCustomLabelClass,
onClick:openLink,
id:"tree" }, document.createElement("div"));
dojo.byId("treeContainer").appendChild(newTree.domNode);
}
}
Is there any other option to rebuild the tree than destroy it first and build it again?
Is there any known problem with IE7?
Thanks in advance for your help,
Best regards,
Micha aka Stiggi
change widget id of tree widget node
Posted December 17th, 2007 by gmilegaI am using tree widget, which nodes are built on server side.
On the client side i want to change tree element's name (which is quite easy with setTitle method), but
i also have to change it's widget id. Since widget id in my tree consisits of id and name e.g. id_name.
And here comes the problem, when i change element's widget id in javascript, dojo.widget.byId() can't find this element by its new id.
How can i solve this.
thnx
Dojo 0.9 Tree, Json, DnD .. Sample Code too much to hope for ? :)
Posted September 28th, 2007 by fraunhofferHey everyone,
Okay, apparently, I am a complete moron, and I am 'okay' with that. I am a de-constructive learner, I learn by tearing things apart and re-building ;) I have got most of the other stuff working fine (validation text boxes, date selectors, etc) under dojo+django. However, the clincher is that the Tree code in 0.9 is .. strange. I grasp the concept of a data store but, when I point it to a JSON url, nothing happens. No node's displayed, updated, etc.
in my html body I have ;
<div dojoType="dojo.data.ItemFileReadStore" jsId="popStore" url="/data/tstjson/"></div>
<div dojoType="dijit.Tree" id="mytree" store="popStore" labelAttr="name"></div>
and I get the following back from the url /data/tstjson/
[{'id': "1", 'text': "Public", 'leaf': "false", 'qtip': "blah", 'qtipTitle': "foo", 'cls': "folder","children":[{'id': "1", 'text': "fred hoskins", 'leaf': "true", 'qtip': "blah", 'qtipTitle': "foo", 'cls': "folder"}]},{'id': "2", 'text': "Private", 'leaf': "false", 'qtip': "blah", 'qtipTitle': "foo", 'cls': "folder","children":[{'id': "1", 'text': "fred hoskins", 'leaf': "true", 'qtip': "blah", 'qtipTitle': "foo", 'cls': "folder"}]},{'id': "3", 'text': "Work", 'leaf': "false", 'qtip': "blah", 'qtipTitle': "foo", 'cls': "folder","children":[{'id': "1", 'text': "fred hoskins", 'leaf': "true", 'qtip': "blah", 'qtipTitle': "foo", 'cls': "folder"}]}]
obviously, you get the idea. 3 categories (okay, with the same person, I know, but, you get the idea hopefully). I have tried with a different id in the children (eg; 11, 22, 33, etc) without any luck either. The dojo environment is all loaded up (I am using the other dojo stuff without trouble).
I also get the feeling reading around that I am not the only one who is having problems, so, does anyone have a -nice- -simple- example of programatically loading a tree using JSON ?
As I said, if I am missing something obvious, feel free to smack me upside the head.
Thanx,
Fraunhoffer
tree drop without moving from list
Posted July 14th, 2007 by hereitcomesHi all, first post here, I hope it's descriptive enough.
I'm very new to dojo and am using two trees on a screen. I want to be able to drag an element from one tree on top of an element
on the other tree. This maps these two elements together, which is recorded in a database. The problem I'm having is that dojo assumes I want the first element to be moved to the second tree.
How do I get dojo to send the info on the element dragged and the element dropped onto to my server (rails) but not remove the element from the tree?
I'm creating the trees dynamically from the database by adding new <div> tags, and it all works fine. Can I override inbuilt functions when I'm building the trees this way?
Thank you
Dojo Forum