3 Replies Latest reply on Jun 2, 2010 6:31 AM by Fis Forums

    Tree Structure to Disable Parent Nodes from Selection

    Fis Forums Level 1

      Hi Guys

       

               Hope all keeps well, Then i have a small doubt in Flex tree structure. i.e need to disable the mouse over function over Parent Node i.e Node with Folder. Here by i have attached image of the tree structure . among the tree i must not allow user to select the Compliance and Type. User can select only Child nodes of  Parent node Type.

       

      Please make any ideas to me to disable the Parent nodes not to be selected.

       

       

      Tree Structure.JPG

       

       

       

       

       

       

       

       

      Thanking you in Advance

       

      With Regards

       

      Gopinath.A

      Software Developer

      Chennai

        • 1. Re: Tree Structure to Disable Parent Nodes from Selection
          samschauhan

          Hey,

           

          In your node creation code set a property, for example, clickable:

           

                    <mx:XMLList>
                          <menuitem label="Products" clickable="false">
                              <menuitem label="Posters"
                                        isBranch="true"/>
                              <menuitem label="CDs" clickable="false">
                                  <menuitem label="Pavement"/>
                                  <menuitem label="Pavarotti"/>
                                  <menuitem label="Phish"/>
                              </menuitem>
                              <menuitem label="T-shirts"
                                        isBranch="true"/>
                              <menuitem label="Tickets"
                                        isBranch="true"/>
                          </menuitem>
                      </mx:XMLList>

           

          and in the Tree tag set:

           

          itemClick="tree_itemClick(event);"

           

          in the AS code put:

           

                    private function tree_itemClick(evt:Event):void {
                          var item:Object = evt.currentTarget.selectedItem;
                          var nonSelectable:Boolean = ((item.hasOwnProperty("@clickable")) && (item.(@clickable == "false")));
                          if (nonSelectable) {
                              tree1.selectedItem = null;
                          }
                      }

           

           

          This will work.

           

          Hope you got the idea.

           

          Thanks & Regards,

          SAM

          • 2. Re: Tree Structure to Disable Parent Nodes from Selection
            samschauhan Level 1

            Did you check? Your question answered now?

            • 3. Re: Tree Structure to Disable Parent Nodes from Selection
              Fis Forums Level 1

              Hi Sam

               

              Thanks for the reply

               

              but i have tried with this sample and when i click on the root node whole tree gets disabled

               

              can you help me in disabling the mouse over function across the root  node (Compliance and Type)

               

              or those two to be masked.

               

              Note : i need the root node to be disabled/masked when it is loaded.either mose over to be blocked

               

              With Regards

               

              Gopinath.A

               

              Software Engineer

               

              Chennai