Hybrid View

  1. #1
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    556
    Vote Rating
    36
    Zdeno has a spectacular aura about Zdeno has a spectacular aura about

      0  

    Default Portal - Add/Remove portlets

    Portal - Add/Remove portlets


    Hi, does anybody has any hint how I can remove and add same portlet into portal?

    Simple case: Portal example with close action on each portlet. OnClose i remove portlet from ownerCt by:
    Code:
    portlet.ownerCt.remove(portlet, false);
    Portlet has rendered property on false. Each portlet is portlets array. When I want add portlet into portal I just do:
    Code:
    this.items.items[0].add(portletsArray[id]);
    Problem is on this line because i receive error in addCls function on line 22634. El is undefined because this element isnt rendered and protoEl property is not defined too. When I check portlet properties i can see ownerCt with correct element. When I try access element by id (or Cmp) i get null value.

    Thank you in advance for any hint.

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Chennai, India
    Posts
    71
    Vote Rating
    2
    a.premkumar is on a distinguished road

      0  

    Default


    Quote Originally Posted by Zdeno View Post
    this.items.items[0].add(portletsArray[id]);
    When you refer to items, it always points to an array. So 'items.items[0]' is wrong. If the second items has index, then the first items will have index too.

    Please be more clear, What is 'portletArray'?

    Regards,
    Premkumar. A

  3. #3
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    556
    Vote Rating
    36
    Zdeno has a spectacular aura about Zdeno has a spectacular aura about

      0  

    Default


    portletArray is nothing else then array of panels. With clear head i found solution (I rewrite big application from Ext 3 to Ext 4). When you check default value of closeAction in Ext 3 you will find 'close'. When you check default value in Ext 4, it's 'destroy'. You can not rely on default values.

    Now back to items. When you check Panel properties, items is Ext.util.AbstractMixedCollection {} - e.g. object. This object contains property items which is array.

Thread Participants: 1