Announcement

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

    Change location of parent when adding a member

    Hi

    I have several nested layouts (VLayouts and HLayouts), which are included inside a tab pane. In one of these layouts (VLayout), there is severall elements which are added or removed dynamically depending on a window of selection. The first time the user makes a selection, the pane moves up several pixels (and you will not see the upper part of the pane). The rest of times, the pain remains in the wrong place.

    In summary, the first adding affects to the top of the pane, and the rest of adding/removing doesn't affect to it.

    This only happens on Chrome. However, Firefox and IE work ok.

    My code of adding is:

    Code:
    int total = itemsPanel.getMembers().length - 1;
    while (total >=0) {
       itemsPanel.removeMember(itemsPanel.getMember(total));
       total--;
    }
    
    
    Record[] records = selectorWindow.getSelectedRows();
    if (records != null) {
       for (Record record : records) {
          String name = record.getAttribute("keyRecord");
          HLayout item = items.get(name);
          itemsPanel.addMember(row);
       }
    }
    if (itemsPanel != null) {
       int r = 80;
       if (Utils.isReducedHeight()) {
          r = 120;
       }
       
       int visibleHeight = getVisibleHeight() - StyleUtils.HEADER_HEIGHT - r;
       itemsPanel.setHeight(Math.max(1, Math.min(itemsPanel.getMembers().length * Utils.getRowHeight(), visibleHeight)));
       int h = Math.min(itemsPanel.getHeight() + 10, visibleHeight);
       containerItemsPanel.setHeight(h);
    }

    I'm using gwt 2.5.1 and smartgwt 3.0. Any idea?

    Thanks in advance
Working...
X