Announcement

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

    Collapse of Nodes does not works in TreeGrid


    The expansion and collapsing of the nodes do not behave as expected. When collapsing the nodes for one category in the example below, it also collapses nodes from other categories that are not part of the same hierarchy.

    FYI - Attached Screenshots.
    1. In the initial fetch we ca see all the eight categories.
    Click image for larger version

Name:	InitialFetch.png
Views:	30
Size:	5.4 KB
ID:	274579

    2. After expanding and collapsing of the nodes the last category gets collapse upon collapsing 'Fleming Baron' category.

    Click image for larger version

Name:	AfterExpand&Collapse.png
Views:	33
Size:	4.9 KB
ID:	274580

    Note - Can see the expanded category upon further expanding the nodes in same hierarchy.

    Expectation - I want to collapse the nodes of the tree grid in same hierarchy.

    Code Snippet :-

    Creation of tree grid and properties used -

    treeGrid = new TreeGrid();
    treeGrid.setDataSource(Constant.DATASOURCE);
    treeGrid.setShowOpenIcons(false);
    treeGrid.setShowDropIcons(false);
    treeGrid.setClosedIconSuffix("");
    treeGrid.setFolderIcon("");
    treeGrid.setShowSelectedIcons(false);
    treeGrid.setHeaderHeight(0);
    treeGrid.setCanSort(true);
    treeGrid.setSortField(Constant.SORT);
    treeGrid.setAutoPreserveOpenState(PreserveOpenState.NEVER);

    Datasource -

    <DataSource ID="ItemSearchSQL"
    serverType="sql"
    tableName="STOCK_ITEMS"
    titleField="categoryName">
    <fields>
    <field name="id" type="integer" primaryKey="true" required="true"/>
    <field name="categoryName" type="text" required="true"/>
    <field name="categoryId" type="int"/>
    <field name="parentCategoryId" type="int"
    foreignKey="ItemSearchSQL.categoryId"
    rootValue="-1" required="true"/>
    <field name="sort" type="int" hidden="true"/>
    </fields>
    </DataSource>




    Attached Files
Working...
X