Announcement

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

    TreeGrid setFixedFieldWidths behaviour change on 4.0p

    Hi,

    Horizontal scrollbar with setFixedFieldWidths(true) set treegrid behaves differently in 4.0p branch compared to 3.1. Reproducible with the following:

    Code:
        public Record gr(int i, Integer parent) {
            Record r = new ListGridRecord();
            r.setAttribute("id", "primarykey" + i);
            r.setAttribute("text", "node " + i);
            if(parent != null)
                r.setAttribute("parent", "primarykey" + parent);
            return r;
        }
    
        public void onModuleLoad() {
            SC.showConsole();
    
            viewport = new VLayout();
            viewport.setWidth100();
            viewport.setHeight100();
            viewport.setMembersMargin(20);
    
            final DataSource ds = new DataSource();
            DataSourceTextField pk = new DataSourceTextField("id");
            pk.setPrimaryKey(true);
            DataSourceTextField text = new DataSourceTextField("text");
            DataSourceTextField parent = new DataSourceTextField("parent");
            parent.setForeignKey("id");
            ds.setFields(pk, text, parent);
            ds.setClientOnly(true);
            ds.setTestData(gr(1, null), gr(2, 1), gr(3, 1), gr(4, 3), gr(5, 4), gr(6, 5), gr(7, 6), gr(8, 7));
    
            final TreeGrid g = new TreeGrid();
            g.setWidth(100);
            g.setHeight(200);
            g.setWrapCells(false);
            g.setFixedFieldWidths(false);
            g.setDataSource(ds);
            g.setAutoFetchData(true);
            TreeGridField f1 = new TreeGridField("text");
            g.setFields(f1);
            viewport.addMember(g);
    
            viewport.draw();
        }
    When run with 3.1 (SmartClient Version: v8.3p_2013-02-16/LGPL Development Only (built 2013-02-16)) and opening up nodes until the content overflows from the right border a horizontal scrollbar appears correctly.

    When run with 4.0p (SmartClient Version: v9.0p_2013-10-22/LGPL Development Only (built 2013-10-22)) the scroll bar does not appear and the content of the cell is cut up.

    Tested with GWT 2.5.1 and latest Chrome 30.0.1599.101.

    br,
    Marko

    #2
    Thanks for the notification. We've made a change to address this issue (will be present in the next nightly build dated Oct 26 or above).
    Also worth noting: The fixedFieldWidths:false setting is somewhat incompatible with headers as the headers don't automatically expand to match the body field widths. This has long been the case.
    If you're showing a header, you may want to experiment with autoFitFieldWidths:true instead

    Regards
    Isomorphic Software

    Comment


      #3
      Seems to be fixed now. Thanks for the hint about the header - we currently have no header in the tree but might have one some day.

      Thanks!

      Comment

      Working...
      X