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.
2. After expanding and collapsing of the nodes the last category gets collapse upon collapsing 'Fleming Baron' category.
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>