Results 1 to 2 of 2

Thread: mix anchor offsets with fix dimensions layout

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    139

    Default mix anchor offsets with fix dimensions layout

    Hi All

    I'm reading ExtJS in Action (great book) and here is an example which doesn't seem to work as described

    Code:
    <html>
      <head>
        <title>Getting Started Example</title>
        <link rel="stylesheet" type="text/css" href="lib/extjs/resources/css/ext-all.css" />
    
        <script src="js/yui/2/build/utilities/utilities.js"></script>
        <script src="lib/extjs/adapter/yui/ext-yui-adapter.js"></script>
        <script src="lib/extjs/ext-all-debug.js"></script>
    
        <script>
            Ext.onReady(function(){
                    Ext.BLANK_IMAGE_URL = 'lib/extjs/resources/images/default/s.gif';
                    Ext.QuickTips.init();
    
                    var myWin = new Ext.Window({
                            height  : 400,
                            width   : 300,
                            layout  : 'anchor',
                            border  : false,
                            anchorSize : '400',
                            items   : [
                            {
                                    title : 'Panel1',
                                    anchor: '-50, -150',
                                    frame : true
                            },
                            {
                                    title : 'Panel2',
                                    height : '150',
                                    anchor: '-10',
                                    frame : true
                            }]
                    }); 
                    myWin.show();
               });
        </script>
      </head>
      <body>
      </body>
    </html>
    Screen shot 2010-06-17 at 9.17.09 PM.png
    'Panel2' should be 150px in hight, but isn't. Any suggestions ?

    cheers
    Luca

  2. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    14

    Default Window height is supposed to be 300

    Hi, I'm reading it at this moment and the height of the window is supposed to be 300.
    Also you are defining height as '150' change it to height:150

    Code:
     Ext.onReady(function(){
                    Ext.BLANK_IMAGE_URL = 'lib/extjs/resources/images/default/s.gif';
                    Ext.QuickTips.init();
    
    
                    var myWin = new Ext.Window({
                            height  : 300,
                            width   : 300,
                            layout  : 'anchor',
                            border  : false,
                            anchorSize : '400',
                            items   : [
                            {
                                    title : 'Panel1',
                                    anchor: '-50, -150',
                                    frame : true
                            },
                            {
                                    title : 'Panel2',
                                    height : 150	,
                                    anchor: '-10',
                                    frame : true
                            }]
                    }); 
                    myWin.show();
               });
    Best regards.

Similar Threads

  1. When should we use anchor layout?
    By madhu_g in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 14 Sep 2009, 3:14 AM
  2. Position Anchor Layout (anchor your component's position and size to their container)
    By tiago.silva in forum Ext 2.x: User Extensions and Plugins
    Replies: 1
    Last Post: 12 Jan 2009, 7:29 PM
  3. xtype: checkbox and layout:border don't mix well?
    By super_drone in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 5 Aug 2008, 7:37 AM
  4. Anchor Layout
    By marco76 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 26 Jan 2008, 2:58 AM

Posting Permissions

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