-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collapsing the tree? #19
Comments
You can use the autoOpen option to open nodes when the tree is loaded. See http://mbraak.github.com/jqTree/#tree-options-autoopen You can also use the openNode function to open a node programmatically. This function is not documented yet. For example in demo.html:
|
But that will expand the tree, I want to do the opposite, so collapsing (closing) the tree |
Oops. There is no function for that yet. Would be a nice feature for the next release. |
The dev branch now contains the function closeNode.
To close a node without animation:
|
Hello, Is there a way to do an expand all/collapse all? Thanks, |
jqTree has no function for that. You could do something like this:
|
Hello |
Let me see if I understand you correctly. You want to add a child node to a parent node; the new node must be the first child. Is that correct? |
yes |
There is no 'add-first-child' function. But you can use the addNodeBefore function. Here is an example: // appendNodeFirst: add 'new_node' as first child to 'parent_node'
function appendNodeFirst($tree, new_node, parent_node) {
if (parent_node.children && parent_node.children.length != 0) {
// Parent has children; add before first child
var first_child = parent_node.children[0];
$tree.tree('addNodeBefore', new_node, first_child);
}
else {
// Parent has no children; append node
$tree.tree('appendNode', new_node, parent_node);
}
}
var parent_node = $tree.tree('getNodeById', 1);
var new_node = {
label: 'new child',
id: 6
}; |
how to merge the nodes |
how to replace rootnode child nodes |
@urprasu |
Hello,
Thanks for this plugin!
Is there a way to collapse the tree or certain nodes of the tree?
Thanks in advance,
seba
The text was updated successfully, but these errors were encountered: