TreeView reloading

I’m having a bit of trouble with TreeView reloading. I want to reload a known, specific element, but I don’t have access to the original object to pass into treeView.reload. It appears that Nova relies on reference equality, so passing a newly made object doesn’t reload at all.

If it is a reference equality issue, I think I’d need a way to inform the tree view about a key or unique ID that it could use to compare elements. Maybe something like adding an optional getKey(element) method to TreeDataProvider that Nova uses to determine if an element is the same as another.

More context here…

1 Like

Hi @apexskier. Have you made any progress on this? I’m not sure I can be of much immediate help, but I am curious.

Nope, I haven’t found anything better than reloading the full tree.

Hi @apexskier. I was reminded of this post after I just posted another question asking something similar.

Did you figure out how to do this?

Nope, no updates unfortunately. I still think an API change with stronger support for tree view keys is needed.

This definitely makes sense. TreeView does indeed use reference equality / === for comparing elements in the tree. I will mark this down as a feature request for the API. :+1:

2 Likes

Thanks for clarifying @logan!