Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8894

Tree in SAPUI5

$
0
0

Hi All,

 

I need to create a tree in SAPUI5  like

 

+MDE-> in code

          +HYDRO-1 -> below from the Query OP

                             +Leaching

                                            + List

 

         

         

and I am using the below code to build


//create the Tree control

  var oTree = new sap.ui.commons.Tree("tree");

  oTree.setTitle("Explorer");

  oTree.setWidth("100%");

  oTree.setHeight("auto");

  oTree.setShowHeaderIcons(true);

  oTree.setShowHorizontalScrollbar(false);

 

 

  //create Tree Nodes

  var oNode1 = new sap.ui.commons.TreeNode("node1", {text:"MDE"});

 

 

//Create a model and bind the table rows to this model

    var oModel = new sap.ui.model.json.JSONModel("/XMII/Illuminator?QueryTemplate=HZL/Analytics/QT/Xqry_GetHierarchy&Content-Type=text/json");

       oTree.setModel(oModel);

  var oNode4 = new sap.ui.commons.TreeNode();

  oNode4.bindProperty('text','Item');

  oTree.bindNodes('/',oNode4);

                                                                   

 

 

  //add Tree Node root to the Tree

 

 

    oTree.bindNodes('/Rowsets/Rowset/0/Row',oNode4);

    oNode1.addNode(oNode4);

 

 

//Bring the table onto the UI

oTree.placeAt("sample1");

 

But I am not getting the OP.

 

Query OP has been attached in the XML. Please let me know the code I have to use?

 

Regards

G.Partheeban


Viewing all articles
Browse latest Browse all 8894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>