Announcement

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

    Nested grid within tree

    I have a tree structure and inside at various tree nodes are tables. Those tables do not share the same columns, so just using a TreeGrid unfortunately not the solution. I tried to solve this with two different approaches. Unfortunatley I got stuck with each of them.


    Approach 1: Nested grid

    I saw in the SmartGWT showcase that there's the possibility of nested grids in ListGrids (and TreeGrid is derived from ListGrid) by using openRecordDetailGrid. Because this methods needs a DataSource, I quickly made a client-only-datasource.
    Unfortunately can't see the nested grid. I guess that's the cause: My datasource works in a seperate ListGrid, as long as I write listGrid.setAutoFetchData(true). Unfortunately, I cannot enable autofetch on the nested grid, because the above mentioned method treeGrid.openRecordDetailGrid(listOrTreeGridRecord, dataSource) is the only one concerning nested grids besides closeRecord().


    Approach 2: use the grid as "attribute"

    I admit that this looks a bit like a dirty hack, but after approach 1 failed I wanted to give it a try:
    I simply packed the ListGrid into a HorizontalPanel and added this by calling treeNode.setAttribute("name", item). That worked; unfortunately the row height is still text height, and the ListGrid takes up much more space, thereby the most part of the other tree nodes which lie beneath.


    Can anyone solve any one of the two problems? Or probably I'm on a complete wrong track. So If you would solve the problem in a different way, please tell me so.

    #2
    See this post. There are some lower-level APIs available that allow you to embed arbitrary widgets. We're looking for sponsors to bring them up to the fully supported level.

    Comment

    Working...
    X