Em 05-08-2012 12:49, Jarrett Meyer escreveu:
My easiest solution has always been to limit the amount of data in edit mode at the same time. Forms with lots of deeply nested objects are complicated. Using tools like KnockoutJS let me keep the single-page app feel, but help limit the amount of data open in simultaneous edit.
I also find approaching editing with a view-binding framework like Knockout a bit hard too.
This is an issue I had in the past when I was using KO and I wanted to be able to handle changes to a template.
The problem is that the changes you make in the text fields will be immediately reflected in your models before any validations or clicking on a confirm button. What if you click on a cancel button? The model has already changed and the other parts of the application bound to the same model will reflect the changes as you change the inputs too even if you didn't click in the confirm button.
This is something I think most MVW (model-view-whatever) frameworks don't handle well. There should be an easier way to be able to store the changes in a separate model clone until you confirm the changes in which case it should propagate the changes to the actual object.
If you see all examples (specially TODO applications) for KO, Ember, Angular, Serenade, etc you'll notice that they won't provide you "confirm" and "cancel" buttons because that would be much harder to implement properly in all those libraries/frameworks.
How do you handle situations like that with KO? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
