Skip to forum content

Mif

— mystic javascript interface

You are not logged in. Please login or register.


Post new reply

Post new reply

Compose and post your new reply

You may use: BBCode Images Smilies

All fields labelled (Required) must be completed before the form is submitted.

Required information for guests



Captcha image. Turn pictures on to see it.
Required information
Optional post settings

Topic review (newest first)

1

implemented expandTo functionality rev29. See docs and demo for more info.

2

temuri wrote:

"expandto" : true, // This property tells the tree that this node's parents should autoexpand to show this node.

This would be very usefull indeed.

3

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

4

implemented rev19

5

moro,

any plans to implement this particular feature?

thx

6

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>