Click to search on your search term.
Subscribe to Fig Leaf Tutorials


Need help with a project? Contact us at sales@figleaf.com.
From code reviews to project "jumpstarts" and full life-cycle development, we've got you covered!
Check out our case studies!
Follow us on Twitter!
Click here to join our Facebook group!

Ready to upgrade your skills? Try these instructor-led classes in Washington, DC:
Ext JS 6 Bootcamp
12/04/2017

Adding and Removing Components

Page of 168

You can add and remove components to/from a container by using the following methods:

  • add (object/Array component)
    Adds a new component to a container.
  • insert (Number index, component)
    Inserts a component into the container at the specified numeric index.
  • remove (Component/String component, bool Autodestroy)
    Removes the specified component from the container, optionally destroying it.
  • removeAt (Number index)
    Removes the component at the specified index
  • destroy()
    Destroys the component. If it is currently added to a container it will first be removed from that container. All DOM references are deleted and the component is de-registered.

Earlier in this class you added the following code to your Application's launch() method in order to dynamically instantiate a series of windows in the viewport's center region:

Ext.ComponentQuery.query('#centerpanel')[0].add([
 { xtype: 'sponsors', x:5, y:20  },
 { xtype: 'earmarks', x: 500, y: 20},
 { xtype: 'sponsorchart', x:500, y: 300}
]);
Page of 168
comments powered by Disqus