angular-ui/ui-grid

TreeNode $$treeLevel logic is wrong

Open

#5,147 建立於 2016年2月19日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)JavaScript (2,496 fork)batch import
help wanted

倉庫指標

Star
 (5,395 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

If you want A ....A.1 ....A.2 ....A.3 B ....B.1 ....B.2 C D E

there is currently no way to inform the grid that C above does not have, and will never have children, and should not be a row-header.

Currently, the only way to ensure an item is not a row header is to set the $$treeLevel = undefined. *This allows the following to pass: *{'ui-grid-tree-header-row': row.treeLevel > -1}

However... The problem with this is row C above will always be bolded. B.2 has $$treeLevel = undefined, is a child of B, so it's OK C has $$treeLevel = null, which makes it correctly not a child of B, BUT, internally, it gets wrongly assigned to row.treeLevel =1, or something... actually not sure how it's passing the test.

See Plunker Demo In this example, "Morgan Sanford", row 45, should not be bold, it has no children. And, setting "Toggle Expand No Children" only partly helps, because the row is still bolded.

貢獻者指南