Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolating changes #1600

Closed
sheldonbaker opened this issue Dec 20, 2013 · 4 comments
Closed

Isolating changes #1600

sheldonbaker opened this issue Dec 20, 2013 · 4 comments

Comments

@sheldonbaker
Copy link

The removal of transactions has broken what I think is a fairly common use case - editing a record via a modal or popover.

E.g., a user enters a post details page which lists the title and body of a post. She clicks an 'edit' button to open a modal overlay that has a form pre-populated with the title and body properties. She updates the title and clicks save. The typical pattern here is that, once the changes were confirmed as successfully persisted to the server, the modal is closed and the post details page is updated.

This is currently not possible with ember-data - one must first post.set('title', 'New post title') before calling post.save() - which would create an odd experience for the user as she would see the title on the post details page update when she clicks save (assuming usage of one-way bindings in the modal form and a manual post.set('title', modalController.get('title')) call).

EPF has 'child sessions' which handle this use case nicely - perhaps something similar could be accomplished with ember-data?

@stefanpenner
Copy link
Member

transactions did not have these semantics. The name lead people to believe they did, but they in-fact did not.

The problem you outline, and EPF begins to address is very real and something we would love to have a good strategy for.

One not-ideal strategy that I have used is to buffer changes in a controller using,
a custom BufferedProxy: https://gist.github.com/lukemelia/5632776
a blog post with more details is here: http://coryforsyth.com/2013/06/27/ember-buffered-proxy-and-method-missing/

@sheldonbaker
Copy link
Author

Interesting - though if I'm understanding it correctly, the BufferedProxy does not totally solve the problem (in the example, 'content.title' still has to be set before the save() is fulfilled).

Is there an active roadmap for this feature or any concrete plans yet on how to solve it? If not, is there any specific starting point in ember-data you're aware of that I might have some success with? The app I'm working on currently uses modals heavily, so this is a problem I need to solve.

Ultimately it might necessitate a switch over to EPF (even if just for the modals).

@stefanpenner
Copy link
Member

no active roadmap, but it is on the docket.

BufferedProxy is abit ghetto but does work. EPF is also a legit choice, if that is what you need.

@stefanpenner
Copy link
Member

Im closing this, as it is not a bug, but rather a known future feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants