Results 1 to 4 of 4

Thread: too many resize and afterlayout?

  1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    580
    Vote Rating
    -2
      0  

    Default too many resize and afterlayout?

    I have a viewport with north and center panels.
    I'm using the center with a cardLayout to load components dynamically from the server,
    that's why I can't use just a north/west/center border layout.
    I've noticed that ext is firing too many resize and afterlayout events.
    I've attached an event listener to several components and when resizing the browser window I'm getting:
    Code:
    hbox-child-resize
    hbox-child-resize
    hbox-layout
    hbox-resize
    hbox-child-resize
    hbox-child-resize
    hbox-layout
    center-layout
    center-resize
    center-layout
    Please drop this html file in the examples folder to test it:
    Code:
    <html>
    <head>
      <title>Complex Layout</title>
    	<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
        
        <!-- GC -->
     	<!-- LIBS -->
     	<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
     	<!-- ENDLIBS -->
    
        <script type="text/javascript" src="../../ext-all.js"></script>
     
    	<script type="text/javascript">
        Ext.onReady(function(){  
           var viewport = new Ext.Viewport({
                layout:'border',
                items:[
                    {
                        region: 'north',
                        height: 50,
                        border: false,
                        tbar: new Ext.Toolbar({
                            id: 'hd-tbar',
                            defaults: {
                                scale: 'medium'
                            },
                            items: [{
                                text: 'btn1',
                            }, {
                                text: 'btn2'
                            }, '-', {
                                text: 'btn3'
                            }, '-', {
                                text: 'btn4'
                            }]
                        })
                    }, {
                        region: 'center',
                        id: 'center',
                        layout: 'card',
                        border: false,
                        bodyBorder: false,
    					activeItem: 0,
    					listeners: {
    						'resize': function(){
    							try {
    								console.info('center-resize');
    							}
    							catch(err){}
    						},
    						'afterlayout': function(){
    							try {
    								console.info('center-layout');
    							}
    							catch(err){}
    						}
    					},
    					items: [{
    						id: 'hbox',
    						listeners: {
    							'resize': function(){
    								try {
    									console.info('hbox-resize');
    								}
    								catch(err){}
    							},
    							'afterlayout': function(){
    								try {
    									console.info('hbox-layout');
    								}
    								catch(err){}
    							}
    						},
    						layout: 'hbox',
    						layoutConfig:{
    							align: 'stretch',
    							pack: 'start'
    						},
    						items: [{
    							title: 'west-hbox',
    							width: 380
    						}, {
    							title: 'center-hbox',
    							flex: 1,
    							listeners: {
    								'resize': function(){
    									try {
    										console.info('hbox-child-resize');
    									}
    									catch(err){}
    								}
    							}
    						}]
    					}]
                    }
                 ]
            });
        });
    	</script>
    </head>
    <body>
     </body>
    </html>
    The try,catch blocks are because I'm having problems with FB 1.4.

    Is this a bug or wrong nesting?

    Thanks

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,234
    Vote Rating
    1015
      0  

    Default

    There's been a number of fixes regarding laying out since 3.x came out. I'd say it will probably go a fair way to alleviating the issue.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    580
    Vote Rating
    -2
      0  

    Default

    There's been a number of fixes regarding laying out since 3.x came out. I'd say it will probably go a fair way to alleviating the issue.
    When wil it be available to download?
    I bought a license but not SVN access.

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    580
    Vote Rating
    -2
      0  

    Default

    can you at least verify that this problem doesn't occur in the latest Ext build
    or maybe I should post it in the bugs section?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •