Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
Madasamy P
Tree view in jsp page
December 29, 2016 4:12 AM
Answer

Madasamy P

Rank: Junior Member

Posts: 82

Join Date: July 27, 2016

Recent Posts

I construct a tree structure in jsp page as,

<div id="myTreeView" style="border-right: 1px solid #D9DADB;"></div>
<aui:script>
function submitForm(){
var clientName="<%=user.getFullName()%>";
var docxFiles=document.getElementById('new_Btn1').files;
AUI().use(
'aui-tree-view',
function(A) {
var treeView=new A.TreeViewDD(
{
boundingBox: '#myTreeView',
children: [
{
children: [
{label: 'Production', leaf: true, type: 'task',id: '11',children:[
{label: clientName, leaf: true, type: 'task',id:'12',children:[

]}
]},

{label: 'Document.docx', leaf: true, type: 'task',id: '13'},
{label: 'CookBook.pdf',leaf: true, type: 'task', id: '14'},
{label: '1.txt', leaf: true, type: 'task' ,id: '15'}

],
expanded: true,
label: 'Title',
type: 'task'
}
]

}).render();

});

}

I want to give multiple file names as children for
{label: clientName, leaf: true, type: 'task',id:'12',children:[

let assume 3 filenames(document.docx, cookbook.pdf and 1.txt) stored to one javascript variable and client name is "Joe Bloggs" are displayed like as,

1.Production
1.1. Joe Bloggs
1.1.1. Document.docx
1.1.2. Cookbook.pdf
1.1.3. 1.txt

I want this structure and need to customize such as adding node and delete nodes

Anyone know about this please concern me

Thanks in advance