Can the adf tree view component be modified to filter which folders to display based on a property?

cancel
Showing results for 
Search instead for 
Did you mean: 
gdarm
Active Member

Can the adf tree view component be modified to filter which folders to display based on a property?

I would like to have the adf tree view component only load folders from the tree if one or more of their properties (node type for example) is a certain value. From the github I can see in the filtering functionality(https://github.com/Alfresco/alfresco-ng2-components/blob/development/lib/content-services/src/lib/tr...) that only nodes which are folders are being displayed, but can this function containing the filetering operaiton be overridden to add more rules/granularity as decribed above when deciding which folders to display? Thanks.

2 Replies
dvuika
Alfresco Employee

Re: Can the adf tree view component be modified to filter which folders to display based on a proper

With the Angular Dependency Injection, you can provide/replace the TreeViewService with your custom implementation. Your service can have more filtering features. Also, you can contribute enhancements to the service source code, if you thin those enhancements bring value to the community.

gdarm
Active Member

Re: Can the adf tree view component be modified to filter which folders to display based on a proper

Hey thank you for the reply! So I have extended the tree view service and overridden its filtering method (getTreeNodes). I've now injected this as a dependency into a component which extends the TreeView component.For reference, the html of this custom component contains just the ADF tree view component tag (adf-tree-view-list). My issue is, the overridden method does not seem to be getting used/called. It just appears to call the default  getTreeNodes().