TreeTable: Filter CustomTreeNodes
See original GitHub issueDescription Type of TreeNodes will be lost after filtering TreeTable. The problem is probably caused by
TreeTableRenderer.createNewNode(TreeNode node, TreeNode parent);
This method will always return DefaultTreeNode or CheckboxTreeNode, even if the Type of parameter node is CustomTreeNode. Because this method is called due filtering (TreeTableRenderer.filter(…)), the type of all nodes will be lost.
Environment:
- PF Version: 8.0
- JSF: Mojarra 2.3.9
Expected behavior createNewNode should return a node with the same type as node in parameter, so that nodes in TreeTable are the same type after filtering as before.
CustomTreeNode node = new CustomTreeNode(...);
TreeNode newNode = createNewNode(node, null) ;
if(newNode instanceof CustomTreeNode){
//correct
}else{
//incorrect
}
Possible solutions
- handle filtering without creating new nodes
- copy node via reflection
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
TreeTable Filter - PrimeNG - PrimeFaces
TreeTable Filter. Filtering is enabled by defining a filter template per column to populate the filters property of the TreTable.
Read more >Filtering for Tree · Issue #1683 · primefaces/primeng - GitHub
The filter could work with the label of the Tree Nodes. In a project I'm using checkable tree nodes and sometimes it gets...
Read more >JavaScript Custom Filters in TreeTable - Webix
Get custom filters in TreeTable сoding samples. Download TreeTable JavaScript example for free.
Read more >Angular PrimeNG TreeTable Filtering - GeeksforGeeks
Angular PrimeNG TreeTable Filtering enables Filter options in the TreeTable component. So using filtering options, we can easily search and ...
Read more >Angular - How to implement TreeView Table with filter
I want to build treeview table with sorting using PrimeNG and Angular 6. TreeTable is there in PirmeNG but i want ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, but thats the current impl. A improvement for the future would be to add a “filtered” flag to the TreeNode and not render again based on this decision.
I see. Please test again - you need to set cloneOnFilter=true now