oracle - How to loaded ExtJS TreePanel from database table column2 as a ChildNode -


`my oracle database , getting tree-panel : input data

  • now display database table column2 asa each parent node child node please let me know how make json data getting result please let me know how child node ?

    my expected result :result

this json data :

[{     "id":1,"reporttreetype":0,"text":"root","reporttype":null,"reporturl":"", "hidden":false,     "children":[{         "id":5,"reporttreetype":0,"text":"hardware","reportt‌​ype":"hardreport","reporturl":"","hidden":false,"children":[], "leaf":false,"dirname":"","href":"","reportid":0,"qtip":""}] 

i have tried extjs tree-panel below getting table-1 column1 parent node not getting column2 child nodes ?

ext .onready(function() {     var tree = new ext.tree.treepanel(             {id : 'treepanel',                 el : 'tree-div',                 usearrows : true,                 title : 'export',                 autoscroll : true,                 width : 250,                 region : 'west',                 animate : true,                 enabledd : true,                 containerscroll : true,                 enablekeyevents : true,                 collapsible : true,                 split : true,                 rootvisible : false,                 border : false,                 // auto create treeloader                 dataurl :'<c:url value="/customize/exportreport.do?method=getexport"/>',                 root : {                     nodetype : 'async',                     text : 'root',                     draggable : false,                     id : '-1',                     expanded:true,                  //here children node cannot able rendered have made mistake ?                     children:[{             text: reportt‌​ype, //treenode java class variable              leaf: true }]         }                 } }); }); 

if understand well, hardware child of root , hardreport child of hardware.

i think there no direct solution in extjs.

  • you change backend send correct data
  • you have manually parse json
  • you load data in first tree store, , build second tree store looping through first.

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -