Forum Discussion

Piyush_77's avatar
Piyush_77
Occasional Contributor
7 years ago

Want to block the Error When Tree nodes are not exapandable

Hello,   I have code in Java script. I want to expand tree node using Expand  command. In which i have  10 items to expand. out of 10  2 are not expandable.  every time when i run the code for that...
  • shankar_r's avatar
    7 years ago

    Another way of doing this and getting to know what are all clicked, etc.

     

          for (i = 0; i < objectChildTreeViewHelp["Items"]["Count"]; i++)
          {
    
                my_array[i] = objectChildTreeViewHelp["Items"]["Item"](i)["Text"]
                stringText="|SoMachine Motion Overview|SoMachine Motion Overview|Releasenotes|"+stringReleaseNotesChildTextName+ "|" +objectChildTreeViewHelp["Items"]["Item"](i)["Text"]
                var stringTextArr = stringText.split("|");
                var currentItem = objectTreeViewHelp.Items("SoMachine Motion Overview");
                var menuToClick = "|SoMachine Motion Overview";
                
                for(ml = 2 ; ml < stringTextArr.length ; ml++){
                      var currentChildMenu = stringTextArr[ml];
                      menuToClick += "|" + currentChildMenu;
                      currentItem = objectTreeViewHelp.Items(menuToClick);
                      if (!strictEqual(currentItem.Items, null)){
                            objectTreeViewHelp["ExpendItem"](menuToClick);
                      }else{
                            objectTreeViewHelp["ClickItem"](menuToClick);     
                      }
                }
                
                Log["Checkpoint"]("Success: "+ my_array[i]+ " RealeaseNote Expanded Successfully")
    
    
          }