[Layouts] Which layout(s) for this app ?

July 4th, 2009
  • Hi everyone,

    I used to deal with Java layouts in the past but Ext implementation of layouts seems to be different in many ways.
    Ext API is not a very good start for beginners so I'm asking for some advices on how to build my app (see attachment below).

    I also had a look to the "Ext 2.0 Gui Designer" but prefer understanding what I'm doing by learning how to do it.


  • Which is pretty much the same as layout:'border' with a center and an east...


  • That looks like a simple Ext.Window with a Ext.TabPanel as the center region and a simple formPanel in the South (or as the button menu on the window).

    Ext Gui Designer is a user created project, its not a supported application for designing you're layouts.

    The Ext API is very simple if you just take the time to read and look into things, if i can grasp it and create a working app then anyone can ;)


  • Maybe Tabpanel with header and bbar?


  • Thank's for quick replies to both of you.

    Some details I forgot are:
    - Main window is resizable
    - When resizing the window, I'd like TextField and TabPanel to fill free space automatically, same in the opposite way...
    - The sending button has to keep its initial size.

    Phunky, I'm gone a give a try to the proposition you just made.


  • Phunky, your solution is working perfectly, I thought BorderLayout needed each region to be filled...
    Now I'm wondering how to position the send button on the right side of the TextField keeping the current resizing behaviour, any idea ?


  • The FormPanel will have to use another layout than 'form'. Perhaps 'column', specifying a fixed column width on the second column, so that the first column takes the rest of the available space.

    Then each column container contains the inupt elements a TextField and a Button.


  • Thank's Animal, I now understand better layouts logic.
    However, I tried the solution you gived and still got a problem.

    Here is the concerned part of the code:

    // TextField
    imTextField = new Ext.form.TextField({
    region: 'center'
    });

    // Sending button
    imSendBtn = new Ext.Button({
    region: 'east'
    });

    // Container for the 2 widgets above
    imInputPane = new Ext.Panel({
    layout: 'border',
    region: 'south', // Position in the main window (border layout too)
    items: [
    imTextField,
    imSendBtn
    ]
    });

    imMainWindow = new Ext.Window({
    layout: 'border',

    items: [
    imTabPane,
    imInputPane
    ],
    });


    When running this code, content of the imInputPane is not displayed. I can only see its header if I set one, but the TextField and sending Button are not visible.


  • The fields cannot be regions, they must go in a Container.

    Don't bother creating Panels, just use config objects and xtypes.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about [Layouts] Which layout(s) for this app ? , Please add it free.

    Navigation

    Calendar

    Blog

    Categories

    Archives
    Search

    Links

    Feeds and Credits