All fields labelled (Required) must be completed before the form is submitted.
You are not logged in. Please login or register.
Mifjs forum — Mif.Tree, Mif.Menu » Feature requests » Expanding nodes based on initial value of JSON array » Post new reply
All fields labelled (Required) must be completed before the form is submitted.
"expandto" : true, // This property tells the tree that this node's parents should autoexpand to show this node.
This would be very usefull indeed.
moro,
I've been testing this feature in the current version. Unfortunately, it does not quite do what it should.
I think my description of expected behaviour was quite confusing.
Let me try again.
Suppose we have the following tree structure:
+ root
|
+---+ Node1
| |
| +---+Node3
| |
| +---Node4
| |
| +---Node5
|
+---+ Node2
JSON property of Node3 look like:
"property":
{
"name": "Node3"
},
"state" :
{
"expandto" : true, // This property tells the tree that this node's parents should autoexpand to show this node.
"open": true // Open node's children Node4 and Node5?
},
"children":
[
{
...
[Node 4 and Node 5 described]
...
}
]
What the tree should do "onLoad" (based on whether `state.expandto` is TRUE) is:
1. Expand Root
2. Expand Node1
3. *Optionally* expand Node3 itself, revealing Node4 and Node5 (read from `state.open`)
What is happening now is: any non-root node that has `state.open` = TRUE is in fact not visible, because all its parents are closed.
I would be extremely nice to have such control over default state of tree nodes.
I hope this is a better explanation & sorry for confusion.
Thanks,
Temuri
implemented rev19
moro,
any plans to implement this particular feature?
thx
Hi moro,
Here's what I am missing.
Structure:
var json=[{
"property":
{
"name": "root"
},
"state" :
{
"open": true
},
"children":
[
{
"property":
{
"name": "node1"
}
}
]
}]
When tree is rendered I want it to expand by default all nodes that have state.open set to true.
Thanks,
T>
Powered by PunBB