This is a migrated thread and some comments may be shown as answers.

TreeView not expanding Parent when value is in model

2 Answers 154 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 20 Jul 2012, 08:09 PM
Issue when including the expanded value in model for datasource the treeview icon changes to plus but does not expand. The selected property works as expected when included in model.

Model:
[{"Name":"Test1","Id":15,"hasChildren":true,"expanded":true,"items":[{"Id":8,"Name":"level2a","hasChildren":false,"selected":false},
{"Id":10,"Name":"level2b","hasChildren":false,"selected":false}],
{"Name":"Test2","Id":14,"hasChildren":true,"expanded":true,"items":[{"Id":9,"Name":"level3a","hasChildren":false,"selected":false}],
{"Name":"Test3","Id":11,"hasChildren":true,"expanded":true,"items":[{"Id":7,"Name":"level3a","hasChildren":false,"selected":false}}]}]

2 Answers, 1 is accepted

Sort by
0
Alexander
Top achievements
Rank 1
answered on 18 Oct 2012, 06:04 PM
I'm currently facing the same issue, have anyone any ideas?
0
Martin
Top achievements
Rank 1
answered on 19 Oct 2012, 09:26 PM
I have the same problem. I've attached a modified version of the treeview/local-data.html example provided with the trial version.

var inlineDefault = new kendo.data.HierarchicalDataSource({
    data: [
        { text: "Furniture", expanded: true, items: [
            { text: "Tables & Chairs" },
            { text: "Sofas" },
            { text: "Occasional Furniture" }
        ] },
        { text: "Decor", items: [
            { text: "Bed Linen" },
            { text: "Curtains & Blinds" },
            { text: "Carpets" }
        ] }
    ]
});
 
$("#treeview-left").kendoTreeView({
    dataSource: inlineDefault
});
Tags
TreeView
Asked by
Rick
Top achievements
Rank 1
Answers by
Alexander
Top achievements
Rank 1
Martin
Top achievements
Rank 1
Share this question
or