Skip to content
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

Angular Tree control multiselection manual nodes selected not working #291

Open
kvkv opened this issue Apr 27, 2018 · 0 comments
Open

Angular Tree control multiselection manual nodes selected not working #291

kvkv opened this issue Apr 27, 2018 · 0 comments

Comments

@kvkv
Copy link

kvkv commented Apr 27, 2018

I am using angular tree control plugin for folder tree structure. Everything is working fine. I am using multiselection option.

When i am fetching the data already selected, I need to maintain the selection status of the nodes.

for fetching data I am using below line

$scope.selectedNodes = [$scope.jsonObject[0],$scope.jsonObject[1],$scope.jsonObject[2]];

But those 3 nodes are not selected. I tried with single selection, it is working fine. But multiselection is not working.

`

$scope.treeOptions = {
nodeChildren: "children",
multiSelection: true,
dirSelectable: true,
injectClasses: {
ul: "a1",
li: "a2",
liSelected: "a7",
iExpanded: "a3",
iCollapsed: "a4",
iLeaf: "a5",
label: "a6",
labelSelected: "a8"
}
};

$scope.jsonObject=
[
{ "id" : 1, "name" : "Metric1", "children" : [
{ "id" : 12, "name" : "Option1", "children" : [
{ "id" : 1211, "name" : "Sub Option1", "children" : [] },
{ "id" : 1212, "name" : "Sub Option2", "children" : [] }
]},
{ "id" : 13, "name" : "Option2", "children" : [
{ "id" : 1311, "name" : "Sub Option1", "children" : [] },
{ "id" : 1312, "name" : "Sub Option2", "children" : [] }
]}
]}
,
{ "id" : 2, "name" : "Metric2", "children" : [
{ "id" : 22, "name" : "Option1", "children" : [
{ "id" : 2211,"name" : "Sub Option1", "children" : [] },
{ "id" : 2212,"name" : "Sub Option2", "children" : [] }
]},
{ "id" : 23, "name" : "Option2", "children" : [
{ "id" : 2311, "name" : "Sub Option1", "children" : [] },
{ "id" : 2312, "name" : "Sub Option2", "children" : [] }
]}
]}
];`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant