Opened 12 years ago
Closed 8 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 12 years ago by
Cc: | Jared Jurkiewicz added |
---|---|
Summary: | Revert underlying datastore doesn't refresh tree → Tree: reverting underlying datastore doesn't refresh tree |
comment:2 Changed 11 years ago by
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 11 years ago by
The tree can listen to the store.revert function and when it fires, just requery/reload the tree.
comment:4 Changed 11 years ago by
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 11 years ago by
Milestone: | tbd → future |
---|
That's a good idea. OK, will try to do that eventually. Like #9869 it needs a refresh method in Tree.
comment:6 Changed 8 years ago by
Summary: | Tree: reverting underlying datastore doesn't refresh tree → Tree: method to rerender |
---|---|
Type: | defect → feature |
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 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Summary: | Tree: method to rerender → Tree: 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.
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.