Opened 10 years ago

Closed 6 years ago

#9226 closed feature (wontfix)

Tree: reverting underlying datastore doesn't refresh tree

Reported by: Lightflowmark Owned by: bill
Priority: high Milestone: future
Component: Dijit Version: 1.3.0
Keywords: revert refresh tree Cc: Jared Jurkiewicz
Blocked By: Blocking:

Description

Calling revert() (or refreshing from server) the underlying datastore of a tree does not update the tree's appearance. See several forum posts for user desire for this.

I believe this is a bug rather than a feature as it violates the MVC paradigm that the tree is built on.

Adding a tree.refresh() function would solve this, if such could be done.

Change History (7)

comment:1 Changed 10 years ago by bill

Cc: Jared Jurkiewicz added
Summary: Revert underlying datastore doesn't refresh treeTree: reverting underlying datastore doesn't refresh tree

I think the problem is that reverting the underlying data store doesn't provide any notification (via the Notification API of dojo.data), so the tree doesn't know that the values have been changed back. Or from another point of view, the problem is that the store sends notifications of changes before those changes have been committed.

I'm not sure we can do anything on the dijit side to fix this; seems like something that needs to change with dojo.data.

comment:2 Changed 10 years ago by bill

Owner: set to Jared Jurkiewicz

Jared, any ideas on this? Or should we just consider it a limitation of how dojo.data is designed?

I could add a tree.refresh() function as suggested above but that's more of a workaround, we should have a separate ticket for that.

comment:3 Changed 10 years ago by Jared Jurkiewicz

The tree can listen to the store.revert function and when it fires, just requery/reload the tree.

comment:4 Changed 10 years ago by Jared Jurkiewicz

Owner: changed from Jared Jurkiewicz to bill

Revert by itself is a notification event. Just connect to the function and when it fires, refresh/reload.

comment:5 Changed 10 years ago by bill

Milestone: tbdfuture

That's a good idea. OK, will try to do that eventually. Like #9869 it needs a refresh method in Tree.

comment:6 Changed 6 years ago by bill

Summary: Tree: reverting underlying datastore doesn't refresh treeTree: method to rerender
Type: defectfeature

The new dojo/store code doesn't even have a revert() method, so I'm not going to spend time worrying about that. It might still be nice to have a reload() or rerender() method for Tree's though, for non-Observe-able stores etc.

The workaround of course is to destroy and recreate the Tree.

comment:7 Changed 6 years ago by bill

Resolution: wontfix
Status: newclosed
Summary: Tree: method to rerenderTree: reverting underlying datastore doesn't refresh tree

Actually, since I'm not going to do anything related to dojo.data's revert() method, I'll just close this in favor of #11065.

Note: See TracTickets for help on using tickets.