Foren

Home » Alloy UI » English

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Tom Mahy
TreeView Checkbox On Parent with JSON
10. November 2011 01:11
Antwort

Tom Mahy

Rang: Regular Member

Nachrichten: 103

Eintrittsdatum: 11. Mai 2011

Neue Beiträge

Hi,

Im trying to create a treeview where you can select (with a checkbox) the parent and that the children are selected aswell.
Here it shows a working example : http://alloy.liferay.com/demos.php?demo=treeview

However i am unable to reproduce this.

The json

1[{ "type" : "check", "checkName": "10435|7Cogs, Inc.", "label": "7Cogs, Inc.", "leaf" : false , "children" : [ { "type" : "check", "checkName": "10760|7Cogs, Inc. Mobile", "label": "7Cogs, Inc. Mobile", "leaf" : true } ] },{ "type" : "check", "checkName": "17702|organisation 1", "label": "organisation 1", "leaf" : true },{ "type" : "check", "checkName": "17708|organisation 2", "label": "organisation 2", "leaf" : true }]


1AUI().use('aui-tree', function(A){
2        var tree = new A.TreeView({
3            type: 'file',
4            boundingBox: '#tree_tags_node',
5            children: data
6            }).render();               
7});


If i remove the child node from the parent node everything works but once i add the field "children" then i get an error :

1invalid 'in' operand config
2[Break On This Error] userTargets = (config && BUBBLETARGETS in config);


I have also tried this with type : task but its the same result.
Any idea what im doing wrong ?
Tom Mahy
RE: TreeView Checkbox On Parent with JSON
25. Januar 2012 23:59
Antwort

Tom Mahy

Rang: Regular Member

Nachrichten: 103

Eintrittsdatum: 11. Mai 2011

Neue Beiträge

bump
Pavel Bigarov
RE: TreeView Checkbox On Parent with JSON
8. März 2012 13:13
Antwort

Pavel Bigarov

Rang: New Member

Nachrichten: 1

Eintrittsdatum: 8. März 2012

Neue Beiträge

I have the same issue.
Is there way to solve the problem?
Thanks.
nicolas fuentes
RE: TreeView Checkbox On Parent with JSON
23. Mai 2014 18:18
Antwort

nicolas fuentes

Rang: New Member

Nachrichten: 1

Eintrittsdatum: 23. Mai 2014

Neue Beiträge

I had the same issue. What I've done is to set type:"checkbox" only for the elements in the last level (not in any parent element).
For example:
 1
 2'[
 3{"id":"modulo_", "label":"aaa","expanded":true, "type":"","cache":true,
 4    children: [{"id":"rubro_", "label":"aaa","expanded":true, "type":"","cache":true,
 5                            children: [
 6                              {"id":"tarea_", "label":"aaa","expanded":true, "type":"check","cache":true},
 7                              {"id":"tarea_", "label":"aaa","expanded":true, "type":"check","cache":true}
 8                            ]
 9         }]
10 }]'


Hope it can help some one.