Forums de discussion

Tree view in jsp page

Madasamy P, modifié il y a 7 années.

Tree view in jsp page

Junior Member Publications: 90 Date d'inscription: 27/07/16 Publications récentes
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