Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Basic Layout issue - sizing members differ when using setters vs. props

    Tested with both SmartClient_v100p_2014-09-25 and smartgwt-3.1p-2013-04-22 with same (unexpected) results.

    When adding a member to a layout, its size will be respected when size is set as property. It is not respected when size is set via setter.

    In the example at the bottom of this post, the left layout yields the expected results. Here, the members are configured with their target width as config property:
    Code:
    isc.HLayout.create({
       ID: "child11",
       width: 100,
       height: "100%",
       backgroundColor: "yellow",
       autoDraw: false
    });
    The right layout comes with the unexpected results. Here, the width is set with a setter:
    Code:
    isc.HLayout.create({
       ID: "child21",
       height: "100%",
       backgroundColor: "yellow",
       autoDraw: false
    });
    child21.setWidth(100);
    Complete Test Case:
    Code:
    isc.HLayout.create({
       ID: "parent1",
       width: 300,
       height: "100%",
       backgroundColor: "green"
    });
    
    isc.HLayout.create({
       ID: "parent2",
       width: 300,
       left: 350,
       height: "100%",
       backgroundColor: "green"
    });
    
    
    isc.HLayout.create({
       ID: "child11",
       width: 100,
       height: "100%",
       backgroundColor: "yellow",
       autoDraw: false
    });
    
    isc.HLayout.create({
       ID: "child12",
       width: 200,
       height: "100%",
       backgroundColor: "blue",
       autoDraw: false
    });
    
    isc.HLayout.create({
       ID: "child21",
       height: "100%",
       backgroundColor: "yellow",
       autoDraw: false
    });
    child21.setWidth(100);
    
    isc.HLayout.create({
       ID: "child22",
       height: "100%",
       backgroundColor: "blue",
       autoDraw: false
    });
    child22.setWidth(200);
    
    parent1.setMembers([child11, child12]);
    parent2.setMembers([child21, child22]);
Working...
X