Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9369

Re: Multiple node select in SAP UI5 tree

$
0
0

var _checkedNodes = [];

 

function getSelectedNodes() {

    var oTree = sap.ui.getCore().byId("Tree"); // Tree Id

   

    oTree.getNodes().forEach(function(node){

       if(node.getIsSelected()) _checkedNodes.push(node);

       _getCheckedSubNodes(node);

  });

 

 

  return _checkedNodes;

}

 

 

function _getCheckedSubNodes(node){

  node.getNodes().forEach(function(subNode){

       if(subNode.getIsSelected()) _checkedNodes.push(subNode);

       _getCheckedSubNodes(subNode);

  });

}

 

getSelectedNodes(); // this is the function for getter selected all nodes.

 

 

 

 

Regards,

Seungwon. ( http://www.sapui6.com )


Viewing all articles
Browse latest Browse all 9369

Trending Articles



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