d'n'd between trees implemented rev33.
Thank you for your great work!
You are not logged in. Please login or register.
Mifjs forum — Mif.Tree, Mif.Menu » Posts by Diksen
Pages 1
d'n'd between trees implemented rev33.
Thank you for your great work!
it works. I had a problem in other place.
Hello, Moro. One more question. After this
insertedNode.recursive(function(){
this.removeType('folder');
});type is removed only in the first child node. I tried to create tree from JSON and manually adding nodes, result is the same.
It works!... after i updated js libs properly. Sorry for my stupid questins, Moro. And thanks for your patience.
I'm sorry, but i see only "Add node" example there. After some debuging, i find that that Mif.Tree.Node constructor runs 2 times for node - once at the moment of creation and the second time when using add function. Every time it gets different UIDs.
I think its my mistake, a hope you tell me where i'm wrong
i'm very sorry, but I still have this problem. I think something wrong with
...this.UID...at the second time it returns the uid that cannot be found. I tried to change it manually in the debug(to value that was expected) and second node is drawn, but with extra vertical line from root node. Could you please help me to find out what is wrong?
Hello, Moro!
Could you please help me to find out where a'm wrong. I want to manually add some nodes, like this:
function formBranch(root){
if(root){
var newNode=new Mif.Tree.Node({
parentNode: root,
tree: tree2
}, {property:{name: 'node1'}});
tree2.add(newNode, root, 'inside');
var newNode2=new Mif.Tree.Node({
parentNode: newNode,
tree: tree2
}, {property:{name: 'node1.1'}});
tree2.add(newNode2, newNode, 'inside');
}
}first node (newNode) adds normally, but second doesn't. It falls in getDOM function. There after
var node=$(this.tree.DOMidPrefix+this.UID);node is still null. What do you think about it?
"expandto" : true, // This property tells the tree that this node's parents should autoexpand to show this node.
This would be very usefull indeed.
It works! Thank you for your support!
I met another problem, after I changed node type (at first deleted old one, and then added another), it didn't change its appearance(and it don't have to). I thought Mif.Tree.Draw.update(node) will help me, but it didn't. Here is the code:
function disablePath(node){
var parent = node.getParent();
if(parent){
parent.removeType('folder');
parent.addType('parent');
disablePath(parent);
Mif.Tree.Draw.update(parent);
}
}Could you please help me to show changed style?
types: { folder:{ openIcon: 'mif-tree-open-icon', closeIcon: 'mif-tree-close-icon', cls: 'my-node-class' } },
Thank you very much. And sorry for bothering you
I found how to do it. It looks like this
types: {
folder:{
cls: 'mif-tree-node-stype'
}
},Sorry, for writing here before trying to find resolution by myself.
Hello moro! How can I add custom css style to node type? I saw this
types: {
folder:{
openIcon: 'mif-tree-open-icon',
closeIcon: 'mif-tree-close-icon'
}
},in your examples, and is it possible to add something like this
name: 'mif-tree-nodeName'to change node font according to its type?
Here's a simpler demo involving only trees: http://www.juniorbug.com/treedemo/simple.html. You should view the page source to gain a better feel for how things work. Also, keep in mind that presently my mods only "copy" nodes from tree to tree... they don't move.
Basically, the only thing you need to do different from normal mif.tree stuff is:
- include my mif.tree-dndmods.js file *after* the standard mif.tree js library. My "mods" file only includes the portions of the library I had to modify to get the multi-tree dnd working, so it's important you include the full mif.tree library as well.
- Declare a global variable called "draggedNode".
- For each tree, set the "draggedNode" variable to "this" when the "onStart" event fires.
- For each tree, set the "draggedNode" variable to "null" when the "onComplete" event fires.
Thank you!
I'll try to make nodes move relaying on your example. I guess I only have to make some changes in your "mods" file?
I had a recent project that required the ability to drag and drop between multiple trees as well as from a tree to a map. I started with Miftree 1.0r19 and hacked it enough to allow dnd between trees. The code is not very elegant, but it works for my purposes. Here's a demo: http://www.juniorbug.com/treedemo/
It's wonderful! This feature is exactly what a need. Could you please share it's realization?
Is it possible to create two trees and organize dnd between them? or move node from 1 tree to another saving tree structure.
thank you for fast reply! you helped me a lot
Hello! Thank you very much for your work. This tree helped me a lot.
I wonder if you are planning to make this abilities in future. If not, what do you think, it will be easy to make this by myself or it's better to look for another solution with this features being realised?
Posts found [ 18 ]
Pages 1
Mifjs forum — Mif.Tree, Mif.Menu » Posts by Diksen
Powered by PunBB