How to update the navigation/pathtree widget correctly?

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

How to update the navigation/pathtree widget correctly?

Jump to solution

Hi,

I have a tree of elements. When creating or deleting items, the tree is updated as it should, but when I change the name of the element, I want the element to be displayed with a new name in the tree. I tried to publish a topic similar to the case with the addition of a new element or the deletion of this one. When I edit name I see that the parent element of the tree collapses and unfolds, but the name doesn't change.

For example, I have such tree (using my custom ChildRequestPublishTopic). After changing the name of the element (for example named "sub222"), I want to reload its parent element and show the new name of the element.

For rendering the tree I use my custom widget that clones an "alfresco/navigation/PathTree" widget and subscribe to onCreate and onDelete:

this.alfSubscribe("MY_ITEM_CREATED", lang.hitch(this, this.onContentCreated));
this.alfSubscribe("MY_ITEM_DELETED", lang.hitch(this, this.onContentDeleted));

It works fine when I create a new tree item or delete one, but when I change the name of an item I try to publish "MY_ITEM_CREATED" or "MY_ITEM_DELETED" with payload, but it doesn't help. I can see that parent item (for example-"22") tries to refresh (collapses and expands), but the name doesn't change. In the log I can see that it has requested child items and got a correct new name of the item.

1 Solution

Accepted Solutions
npavlov
Active Member II

Re: How to update the navigation/pathtree widget correctly?

Jump to solution

I have to modify function 

refreshTreeNode: function alfresco_navigation_PathTree__refreshTreeNode

and after collapse tree I add 

delete this.tree._itemNodesMap[treeNode.getIdentity()];

to delete its saved values.

View solution in original post

4 Replies
jpotts
Professional

Re: How to update the navigation/pathtree widget correctly?

Jump to solution

Screenshots and sample code might make it easier for others to provide assistance with this.

npavlov
Active Member II

Re: How to update the navigation/pathtree widget correctly?

Jump to solution

done

npavlov
Active Member II

Re: How to update the navigation/pathtree widget correctly?

Jump to solution

I have to modify function 

refreshTreeNode: function alfresco_navigation_PathTree__refreshTreeNode

and after collapse tree I add 

delete this.tree._itemNodesMap[treeNode.getIdentity()];

to delete its saved values.

eliosn
Active Member II

Re: How to update the navigation/pathtree widget correctly?

Jump to solution

How did you do to customize the icons?