UI Grid tree view fails to apply correct custom row header template to tree node on collapse of its childrens
#5.570 aberto em 20 de jul. de 2016
Métricas do repositório
- Stars
- (5.395 stars)
- Métricas de merge de PR
- (Nenhuma PRs mesclada em 30d)
Description
steps to reproduce the issue :
1] I used basic tree view example mentioned in http://ui-grid.info/docs/#/tutorial/215_treeView
2] Then I have added new custom row header template 'alternateTemplate.html' in the plunker (mentioned below).
3] Then added row header column using '$scope.gridApi.core.addRowHeaderColumn' function
4] Then introduced new data flag 'isRowNode' in each row data (get from json file in the sample code). For the 0th level tree nodes (which are hard coded to 0,5,10 rows) isRowNode = 1, and for all other rows isRowNode = 2. In 'alternateTemplate.html' using ng-if checked the value of isRowNode and if its 1 then apply template 1 and if its 2 then apply other template (template 2)
5] Now we have 3 tree (0th level) nodes in grid, of which 1st tree node (0th) applied with template 1 correctly. However other tree nodes 2nd and 3rd (at 5th and 10th location in grid) gets incorrect Template 2 when the tree nodes are in collapse state. If you expand the first tree node then you can see the second tree node is now getting the correct row header template 1.
6] I have created a plunker to demonstrate the same : http://plnkr.co/edit/PxdefzjsnpoX0O7PFxjn you can see that when tree nodes are collapsed, 'Template 2' is getting applied on 2nd and 3rd tree nodes, but when you expand all tree nodes correct 'Template 1' will get applied on tree nodes. And all the children nodes have 'Template 2' correctly applied.
Problem :
By looking at the above mentioned behavior it seems that (in UI Grid tree view) while any subsequent row collapse on tree node, row headers (for collapsed/hidden rows) are not considered and its old template data remains there and hence causes the inconsistency in the tree view.