Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    removeSection not destroying items (bug or rookie)?

    Be gentle I'm kinda new :)

    This code reproduces the issue (by pressing the destroy button):
    Code:
    isc.VLayout.create({                
      ID:"mypane",
      autoDraw: false,
      members:[
          
                 isc.Button.create({
     	              title:"destroy",
     	              autoDraw: false,
     	              click:" ssVendorStack.removeSection('mystack')"
     	           })
              ]
    });
    isc.TabSet.create({
                          ID: "MYID" + ".tabs",
                          autoDraw: false,
                          tabs:[ {title:"Items", pane:"mypane"} ]
                       });
    isc.SectionStack.create({
         			ID:"ssVendorStack",
         			width: "50%",
         		  height:"50%",
         		  overflow:"visible",
         			border: "1px solid black",
         			sections: [   
         			  {title: "Top Stack", expanded: true, items: [ ] }
         			]             
         })                 
         
    ssVendorStack.addSection({
              ID: "mystack",
              title: "mystack",
             	overflow: "auto", 
             	expanded: true,
             	
             	redrawOnStateChange: false,
             	items: [
              	        isc.LayoutSpacer.create({ height: 10 }),
              	        isc.VLayout.create({                
                        width: "100%",
                        height: 310,
                       	overflow: "auto", 
                        
                        members:[
                 				         	isc.Canvas.getById("MYID" + ".tabs")
    		       	                ]
    		                })
    		    	     ]
    	        });
    A simple workaround is to destroy the items first but, wonder if I am doing something wrong?

    SmartClient Version: SC_SNAPSHOT-2010-09-23/LGPL Deployment (built 2010-09-23)
    Browser: firefox

    #2
    In general, destroying a parent will destroy it's children. This is true of destroying the SectionStack as a whole, destroying any Layout, Window, etc.

    However the section is not actually the parent of the items within that section, they are both children of the SectionStack instead. So there is no automatic destruction in this case and you should destroy the items directly if you want to get rid of them.

    Comment

    Working...
    X