How can I Dynamically add a Component to Panels?

edited October 2012 in Newbie Questions
I want enyo.Panels to behave as a stack for view navigation. How can I dynamically add a component to an enyo.Panels component - especially when it has already been instantiated?

Unfortunately, the only example I have found shows how to use createComponent (with an object literal) - but not addComponent.

bootplate/lib/layout/panels/samples/PanelsSample.js (addPanel function)

How can I dynamically add a component to an enyo.Panels component - especially when it has already been instantiated?

Comments

  • CreateComponent adds to an already instantiated object if it exists.

    This. $. Panel. CreateComponent...

    Will add the component panel element to the panel control.
  • In Enyo 1 (and I think I tried this in 2) you can declare components as kind object definitions OR already instantiated objects:
    ...
    components: [
       {blah blah blah},
       refToAlreadyInstantiatedKind,
       {blah blah blah}
    ]
    ...
    Sooooo....I THINK you should be able to pass an already instantiated kind directly to createComponent like strider73 mentioned.
Sign In or Register to comment.