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

Tree openOnChecked not working #60

Open
alterwiel opened this issue Aug 6, 2015 · 0 comments
Open

Tree openOnChecked not working #60

alterwiel opened this issue Aug 6, 2015 · 0 comments

Comments

@alterwiel
Copy link

I have the following code, which all works, except for the openOnChecked property of the tree. Are there any obvious mistakes here?

var layers = {};
layers.label = 'name';
layers.identifier = 'name';
layers.items = [];
layers.items.push({ id: -1, type: 'root', label: 'Root', name: 'Root' });

 // data is result of a call to a REST service
array.forEach(data.layers, function (item) {
   if (item.parentLayerId < 0) {
       layers.items.push({ id: item.id, type: 'parent', label: item.name, name: item.name, parent: -1, subLayerIds: item.subLayerIds });
   }
   else {
       layers.items.push({ id: item.id, type: 'child', label: item.name, name: item.name, parent: item.parentLayerId, subLayerIds: item.subLayerIds }); 
   }
});

var store = Observable(new Memory({ data: layers.items }));
that._model = new TreeStoreModel({
   store: store,
   query: {
        id: -1
   },
   rootLabel: "Layers",
   checkedRoot: true
});

var tree = new Tree({
    model: that._model,
    id: "MenuTree",
    openOnChecked: true
}, that.checkboxTreeDiv);
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