Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2712

Tree scroll position didn't clear when setting new model and then invalidate

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.7, 7.0.5
    • Fix Version/s: 6.5.8, 7.0.6
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 7.0.7

      Description

      Reproduce steps:
      1. Scroll to most bottom and click on item98 to select it.
      2. Click "Switch to smaller model" button. The scrollbar position is incorrectly.
      Reproducible sample:

      <zk>
          <window border="normal" title="hello">
      <zscript><![CDATA[
      DefaultTreeNode root = new DefaultTreeNode("root", new ArrayList());
      for (int i = 0; i < 99; i++) {
          root.add(new DefaultTreeNode("item " + i));
      }
      DefaultTreeModel model = new DefaultTreeModel(root);
      void invalidate() {
          root.getChildren().clear();
          root.getChildren().add(new DefaultTreeNode("New item"));
          tree.setModel(new DefaultTreeModel(root));
          tree.invalidate();
      }
      ]]></zscript>
              <button id="btn" label="Switch to smaller model" onClick="invalidate()" />
              <vlayout height="100px" width="200px">
                  <tree id="tree" model="${model}" vflex="1">
                      <treecols>
                          <treecol label="Treecol" />
                      </treecols>
                  </tree>
              </vlayout>
          </window>
      </zk>
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              DevChu DevChu
              Reporter:
              vincentjian vincentjian
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h