Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User kubens's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    136
    Vote Rating
    0
    kubens is on a distinguished road

      0  

    Default How I can move a ContentPanel from region center to east

    How I can move a ContentPanel from region center to east


    I am in search of a solution for moving contentpanels from region center to region east. I create inside my application dynamically contentpanels.

    Code:
    layout.add(region, new Ext.ContentPanel('ifrm', {fitToFrame:true, title:id, closable:true, autoCreate:{tag:'iframe', src:url, id:'ifrm'+id, name:'ifrm'+id, frameborder: 'no'} }));
    So far so good. Now I switch the alignment of different panels from horizontal to vertical and therefore I must move the contentpanels. Of course I can delete the existing contentpanels and recreate them again, but this isn't what I want. I realy interested into a simple move from region A to region B

    Any hints for me ?

    Kind regards
    Wolfgang

  2. #2
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    122
    Vote Rating
    0
    kalebwalton is on a distinguished road

      0  

    Default


    You should be able to do something like this:

    Code:
    var layout = new Ext.BorderLayout(document.body, {
      west: {
        preservePanels: true
      },
      center: {
        preservePanels: true
      }
    });
    var contentPanel = <some ContentPanel>;
    layout.add("west", contentPanel);
    layout.remove("west", contentPanel);
    layout.add("center", contentPanel);
    All without destroying the contentPanel. The key is preservePanels: true in the region configuration which says not to destroy a panel when it's removed.

  3. #3
    Sencha User kubens's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    136
    Vote Rating
    0
    kubens is on a distinguished road

      0  

    Default


    Thanks for your explaination. In the meantime I found 'preserverPanels' in BasicLayoutRegion.remove, but I have oversight, that this could solved as described by you too. So one part seems to be solved, but there is another part which is still open...

    I use an iframe to load an url directly in the contentpanel. If I now move the panel from region A to region B then I recognized that the linked url of the contentpanel is requested again and that I lost therefore any changes in those contenpanels. Any ideas about that behaviour?

    Code:
    layout.add(region, new Ext.ContentPanel('ifrm', {fitToFrame:true, title:id, closable:true, autoCreate:{tag:'iframe', src:url, id:'ifrm'+id, name:'ifrm'+id, frameborder: 'no'} }));
    Br
    Wolfgang

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    122
    Vote Rating
    0
    kalebwalton is on a distinguished road

      0  

    Default


    Are you sure you're reusing the existing ContentPanel?

    Your code:

    Code:
    this.layout.add(region, new Ext.ContentPanel('ifrm', {fitToFrame:true, title:id, closable:true, autoCreate:{tag:'iframe', src:url, id:'ifrm'+id, name:'ifrm'+id, frameborder: 'no'} }));
    Should it be?
    Code:
    this.myContentPanel = new Ext.ContentPanel('ifrm', {fitToFrame:true, title:id, closable:true, autoCreate:{tag:'iframe', src:url, id:'ifrm'+id, name:'ifrm'+id, frameborder: 'no'} });
    layout.add(region, this.myContentPanel);
    And when you do the remove/re-add:
    Code:
    this.layout.remove(region, this.myContentPanel);
    this.layout.add(otherRegion, this.myContentPanel);

  5. #5
    Sencha User kubens's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    136
    Vote Rating
    0
    kubens is on a distinguished road

      0  

    Default


    Sorry for cause this confusion. This is the code which generates a contentpanel:

    Code:
    var id=4711;
    var url='http://myapp.localhost/form1.php?id=4711';
    var region='center';
    
    layout.add(region, new Ext.ContentPanel('ifrm', {fitToFrame:true, title:id, closable:true, autoCreate:{tag:'iframe', src:url, id:'ifrm'+id, name:'ifrm'+id, frameborder: 'no'} }));
    This code moves the panels between two regions:

    Code:
    var srcRegion=layout.getRegion('center');
    var dstRegion=layout.getRegion('east')
    var panel = null;
    var panels = new Array(); 
    for(var i=0, len=srcRegion.panels.length; i<len; i++) {
      panel = srcRegion.panels.get(i);
      if (panel.getId() != 'htmlPanelGrid') {
        panels[panels.length] = panel;
      }
    }
    for(var i=0, len=panels.length; i<len; i++) {   
      panel = srcRegion.remove(panels[i].getId(), true);
      layout.add(dstRegion.getPosition(),panel);
    }
    Hope this helps to clarify the confusion

    Br
    Wolfgang

  6. #6
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    122
    Vote Rating
    0
    kalebwalton is on a distinguished road

      0  

    Default


    So everything is working except the iframe is "refreshed" in the process?

  7. #7
    Sencha User kubens's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    136
    Vote Rating
    0
    kubens is on a distinguished road

      0  

    Default


    Move contentpanels works very well
    Iframes reloading drives me crazy :cry:

  8. #8
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    122
    Vote Rating
    0
    kalebwalton is on a distinguished road

      0  

    Default


    Ah! I bet it is the autoCreate. You should create that iframe separately otherwise the Panel probably re-creates it each time it's removed/re-added.

  9. #9
    Sencha User kubens's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    136
    Vote Rating
    0
    kubens is on a distinguished road

      0  

    Default


    Sounds logical, sometimes it is not possible to see the wood for the trees
    I will check this, but for today it is too late. I will keep you informed about this.

    Thanks
    Wolfgang

  10. #10
    Sencha User kubens's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    136
    Vote Rating
    0
    kubens is on a distinguished road

      0  

    Default


    I checked both autocreate and not today and my results were: In IE it works as expected and in Firefox the iframes were still reloaded. Normally my personal slogan is: Don't support Bill ... But this time I am a little bit disappointed, I never expected Firefox as cause for this behaviour :cry:

    May anybody knows how I can prevent this reloading issue on the iframe.

    Br
    Wolfgang

Similar Threads

  1. [OPEN] Yui menus only visible in center region in IE?
    By jarrod in forum Ext 1.x: Bugs
    Replies: 6
    Last Post: 1 Nov 2008, 4:20 AM
  2. Creating Ajax tabs in center region of BorderLayout
    By booshan in forum Ext 2.x: Help & Discussion
    Replies: 9
    Last Post: 4 Apr 2007, 8:21 PM
  3. Add Tabs to center region of nested layout
    By subhav in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 12 Mar 2007, 2:53 AM
  4. Problem with nested layout with east west region
    By rahulmca1@gmail.com in forum Ext 1.x: Help & Discussion
    Replies: 10
    Last Post: 7 Mar 2007, 2:25 AM
  5. ContentPanel fitToFrame on "center" region
    By arnair in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 7 Nov 2006, 3:35 PM

Thread Participants: 2