EasyUI Forum

General Category => Bug Report => Topic started by: Lioncat on April 05, 2016, 05:32:05 PM



Title: Tree json bug
Post by: Lioncat on April 05, 2016, 05:32:05 PM
Using demo/lines.html, change data-options="url:'tree_data1.json' to following json which is the example on your Tree  Documentation, would be rendered as this:(http://jsonTree.png), the folder "Sub Bookds" will get into infinite loop to root node when open it
Code:
[{
    "id":1,
    "text":"Folder1",
    "iconCls":"icon-save",
    "children":[{
        "text":"File1",
        "checked":true
    },{
        "text":"Books",
        "state":"open",
        "attributes":{
            "url":"/demo/book/abc",
            "price":100
        },
        "children":[{
            "text":"PhotoShop",
            "checked":true
        },{
            "id": 8,
            "text":"Sub Bookds",
            "state":"closed"
        }]
    }]
},{
    "text":"Languages",
    "state":"closed",
    "children":[{
        "text":"Java"
    },{
        "text":"C#"
    }]
}]


Title: Re: Tree json bug
Post by: jarry on April 06, 2016, 04:09:07 AM
You can not set the 'closed' state for a leaf node, please try this code instead.
Code:
        },{
            "id": 8,
            "text":"Sub Bookds",
            "state":"open"
        }]


Title: Re: Tree json bug
Post by: Lioncat on April 06, 2016, 04:57:19 AM
This is the example on your Tree  Documentation