Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: AlloyUI Treeview : Single Select (Please Help)
Hello,
I am using Liferay DXP and I use aui treeview for single select (means, I want to check only one checkbox) but I can't find
any solution to do it. I put 'type=radio' on my treeview but it is not working.
Please, help me, any suggestion is welcomed.
Thank you in advanced,
Koffi
I am using Liferay DXP and I use aui treeview for single select (means, I want to check only one checkbox) but I can't find
any solution to do it. I put 'type=radio' on my treeview but it is not working.
Please, help me, any suggestion is welcomed.
Thank you in advanced,
Koffi
Hi,
Have u checked https://alloyui.com/examples/tree/real-world.html , this may help you.
Example
Have u checked https://alloyui.com/examples/tree/real-world.html , this may help you.
Example
<div id="myTreeView"></div>
<aui:script>
AUI().use(
'aui-tree-view',
function(A) {
new A.TreeViewDD(
{
boundingBox: '#myTreeView',
children: [
{
children: [
{label: 'Watermelon', leaf: true, type: 'check'},
{label: 'Apricot', leaf: true, type: 'check'},
{label: 'Pineapple', leaf: true, type: 'check'},
{label: 'Kiwi', leaf: true, type: 'check'},
{label: 'Orange', leaf: true, type: 'check'},
{label: 'Pomegranate', leaf: true, type: 'check'}
],
expanded: true,
label: 'Checkboxes'
},
{
children: [
{label: 'Watermelon', leaf: true, type: 'radio'},
{label: 'Apricot', leaf: true, type: 'radio'},
{label: 'Pineapple', leaf: true, type: 'radio'},
{label: 'Kiwi', leaf: true, type: 'radio'},
{label: 'Orange', leaf: true, type: 'radio'},
{label: 'Pomegranate', leaf: true, type: 'radio'}
],
expanded: true,
label: 'Radio'
},
{
children: [
{label: 'Watermelon', leaf: true, type: 'task'},
{label: 'Apricot', leaf: true, type: 'task'},
{label: 'Pineapple', leaf: true, type: 'task'},
{label: 'Kiwi', leaf: true, type: 'task'},
{label: 'Orange', leaf: true, type: 'task'},
{label: 'Pomegranate', leaf: true, type: 'task'}
],
expanded: true,
label: 'Task',
type: 'task'
}
]
}
).render();
}
);
</aui:script>
Hello Yasin,
Thank you very much, you have helped me a lot. I can't see that each JSON line have a 'type' property, so your answer
helps me a lot.
Thank you,
Have a nice day,
Koffi
Thank you very much, you have helped me a lot. I can't see that each JSON line have a 'type' property, so your answer
helps me a lot.
Thank you,
Have a nice day,
Koffi
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™