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.
Solved! Go 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.
Screenshots and sample code might make it easier for others to provide assistance with this.
done
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.
How did you do to customize the icons?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.