Framework: TreeGrid with DetailHandler broken

Created on 2 Nov 2018  路  6Comments  路  Source: vaadin/framework

  • Vaadin Framework version 8.6.0
  • Browser version all Browsers, currently working with Chrome Version 70.0.3538.77 (64-bit)
  • Web container name and version Apache Tomcat Version 9.0.8
  • Description of the bug Combination of TreeGrid with a DetailHandler is broken. Initially the grid looks fine. But as soon as the tree grid collapses a row, the details are listet at wrong position, and row hight is sometimes faulty too.
  • Expected behavior: If a group of rows is collapsed, that part is hidden and the remaining rows move up to use the grid space. After collapsing and expanding rows, the grid should look the same.
  • Actual behavior
    If you collapse and expand the detail handler, the position is faulty.

  • Minimal reproducible example
    ```private TreeGrid createTestGrid() {
    TreeGrid classGrid = new TreeGrid();

    TreeData treeData = ((TreeDataProvider) classGrid.getDataProvider()).getTreeData();
    classGrid.addColumn(row -> row.getSimpleName()).setId("simpleName");
    classGrid.setDetailsGenerator(row -> new Label("details for " + row.getSimpleName()));

    treeData.clear();
    Class listClazz = List.class;
    treeData.addItem(null, listClazz);
    Class arrayListClazz = ArrayList.class;
    treeData.addItem(listClazz, arrayListClazz);
    classGrid.expand(listClazz);

    Class setClazz = Set.class;
    treeData.addItem(null, setClazz);
    Class hashSetClazz = HashSet.class;
    treeData.addItem(setClazz, hashSetClazz);
    classGrid.expand(setClazz);

    classGrid.setDetailsVisible(listClazz, true);
    classGrid.setDetailsVisible(arrayListClazz, true);
    classGrid.setDetailsVisible(setClazz, true);
    classGrid.setDetailsVisible(hashSetClazz, true);

    return classGrid;
    }
    ```

BFP

Most helpful comment

Its working great now!
Thanks a lot

All 6 comments

initial-grid
grid-after-collapse-expand

Your description is very similar to a Grid bug https://github.com/vaadin/framework/issues/11139 that should have been fixed by this https://github.com/vaadin/framework/pull/11154

If it has been fixed, its not working for vaadin 8.6.0.
Please try the example code and see for yourself.

I also still have the same issues in the grid in 8.6.0 as described here https://github.com/vaadin/framework/issues/11139

currently shipped with 8.9.0.beta3.
final release will be in two weeks.

Its working great now!
Thanks a lot

Was this page helpful?
0 / 5 - 0 ratings