1. #1
    Ext Premium Member
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
    ckotyan is on a distinguished road

      0  

    Default Card Layout not responding to doLayout after setting it active.

    Card Layout not responding to doLayout after setting it active.


    I am evaluating a prototype for our application using Ext JS Card layout.
    When I hide a Card and bring another one to the front and then again go back to the old Card the call to doLayout (on the owner container of the panel as well as the panel) it is not restoring the panel to the restored mode (the original layout/size of the panel).
    YOur advice is much appreciated?

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Are you hiding and showing cards? You should let the card layout take care of that (using container.layout.setActiveItem).

    Also, you can configure the card layout to do a layout automatically (layoutConfig:{layoutOnCardChange:true}).

    Finally, CardLayout only works if the container has a fixed size (either specified or assigned by it's parent layout).

  3. #3
    Ext Premium Member
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
    ckotyan is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    Are you hiding and showing cards? You should let the card layout take care of that (using container.layout.setActiveItem).

    Also, you can configure the card layout to do a layout automatically (layoutConfig:{layoutOnCardChange:true}).

    Finally, CardLayout only works if the container has a fixed size (either specified or assigned by it's parent layout).
    I am not hiding/showing the cards. I am setting the active item as you said.
    The scenrio is this:
    I have 2 Cards (regular container and a container for maximized panels), When I click on the maximize tool icon of a panel, I hide the source panel remove it from its owner container and add it to a container inside maximizepanel card and set the active item as the maximizepanelcard.

    Following are the functions I have written. Maximize is called first which seem to work fine; followed by when I invoke restore function, the inside panel (being restored) is not resizing itself and so the bottom toolbar of the panel is going away from the viewable area of the panel.

    Please let me know if you need more info.

    function maximizePanel(panel){//panel is not extjs panel object just a JSON
    var maximizePanel = Ext.getCmp("viewportsetcards-maximize-panel");
    var p = Ext.getCmp(panel.id);
    p.hide();
    var owner = p.ownerCt;
    owner.remove(p, false);
    if (p.originalOwnerId == null) {
    p.originalOwnerId = owner.id;
    }
    p.tools.restore.setVisible(true);
    p.tools.maximize.setVisible(false);
    maximizePanel.add(p);
    maximizePanel.doLayout();
    p.doLayout();
    p.show();
    viewportSetCards.layout.setActiveItem('viewportsetcards-maximize-panel');
    }
    function restorePanel(panel, previousViewportSet){//panel is not extjs panel object just a JSON
    var p = Ext.getCmp(panel.id);
    var owner = p.ownerCt;
    p.hide();
    owner.remove(p, false);
    var originalOwner = Ext.getCmp(p.originalOwnerId);
    p.tools.restore.setVisible(false);
    p.tools.maximize.setVisible(true);
    originalOwner.add(p);
    p.show();
    p.doLayout();
    originalOwner.doLayout();
    viewportSetCards.layout.setActiveItem(previousViewportSet);
    }

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Remove:
    Code:
    maximizePanel.doLayout();
    p.doLayout();
    p.show();
    and either use layoutOnCardChange:true or call maximizePanel.doLayout() after calling setActiveItem.

  5. #5
    Ext Premium Member
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
    ckotyan is on a distinguished road

      0  

    Default


    Cool, this worked great time. Thanks a lot Condor. You guys rock.

  6. #6
    Ext Premium Member
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
    ckotyan is on a distinguished road

      0  

    Default


    But I saw setActiveItem is not working properly in Ext 3.0, is this fixed in 3.2.0?
    In 3.0 it is resulting in JS error inside setWidth function of Ext debug js file.

  7. #7
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Yes, that should be solved in Ext 3.2.

  8. #8
    Ext Premium Member
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
    ckotyan is on a distinguished road

      0  

    Default


    thanks for the info Condor.

Similar Threads

  1. Replies: 3
    Last Post: 19 Feb 2010, 5:00 PM
  2. How to get active index of card layout?
    By dbassett74 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 17 Sep 2009, 4:26 PM
  3. Card Layout Active Item
    By jeroenooms in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 2 Sep 2009, 6:21 AM
  4. Card layout: changing active item in Panel fails
    By Philippe_Fery in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 29 Apr 2008, 5:59 AM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar