1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    baluba is on a distinguished road

      0  

    Default [CLOSED] TableLayout does size correctly

    [CLOSED] TableLayout does size correctly


    Hi,

    The following self-contained example code shows that panels that are added to a container which has a TableLayout are not layed out properly.
    The left and right contentpanel in the code below are sized properly in reference to eachother, but they do not fill up the parent main container.


    Code:
    public class TableLayoutProblem implements EntryPoint {
    
        public void onModuleLoad() {
            final Viewport viewport = new Viewport();
            viewport.setLayout(new FillLayout(20));
            viewport.setBorders(true);
    
            // create a container with table layout, two columns, one row
            Container main = new Container();
            main.setBorders(true);
            TableRowLayout tableLayout = new TableRowLayout();
            tableLayout.width = "100%";
            main.setLayout(new TableRowLayout());
    
            final ContentPanel left = new ContentPanel();
            left.setWidth("100%"); // no effect
            left.border = true;
    //        left.setLayout(new FillLayout());
            TableData leftLayoutData = new TableData(Style.HorizontalAlignment.CENTER, Style.VerticalAlignment.MIDDLE);
            leftLayoutData.width = "30%";  
            main.add(left, leftLayoutData);
    
    
            final ContentPanel right = new ContentPanel();
            right.setWidth("100%");  // no effect
            right.border = true;
    //        right.setLayout(new FillLayout());
            TableData rightLayoutData = new TableData(Style.HorizontalAlignment.RIGHT, Style.VerticalAlignment.MIDDLE);
            rightLayoutData.width = "70%";
            main.add(right, rightLayoutData);
    
            viewport.add(main);
            viewport.layout(true);
            RootPanel.get().add(viewport);
            DeferredCommand.addCommand(new Command() {
                public void execute() {
                    left.layout(true);
                    right.layout(true);
                    viewport.layout(true);
                }
            });
        }
    }

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,241
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    Try this code with beta2:
    Code:
      public void onModuleLoad() {
        Viewport viewport = new Viewport();
        
        TableRowLayout layout = new TableRowLayout();
        layout.width = "100%"; // sets the width of the table element
        layout.cellSpacing = 2;
        viewport.setLayout(layout);
        viewport.setBorders(true);
    
        ContentPanel left = new ContentPanel();
        left.setBorder(true);
        TableData leftLayoutData = new TableData(HorizontalAlignment.CENTER, VerticalAlignment.MIDDLE);
        leftLayoutData.width = "30%";  
        viewport.add(left, leftLayoutData);
    
    
        ContentPanel right = new ContentPanel();
        right.setBorder(true);
    
        TableData rightLayoutData = new TableData(HorizontalAlignment.RIGHT, VerticalAlignment.MIDDLE);
        rightLayoutData.width = "70%";
        viewport.add(right, rightLayoutData);
    
        RootPanel.get().add(viewport);
      }

  3. #3
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    baluba is on a distinguished road

      0  

    Default


    Works ok! Thank you.

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