kmalakoff/knockback — Issue #10: Ability to change/rebind a Model or ModelRef
Author: kmalakoff
Created: 2011-11-05 11:39:29+00:00
State: open

I can see two use cases where you would want to change/rebind a model or model ref:

1) A classic iPad layout - you render a list view for a collection in a column on the left and when you click on one of the entries, you replace the model or model ref in the view model on the right (in other words, rebinding the view model rather than generating a new model view for the newly selected model).

2) A new model generator - you could for example create a new model (eg. no model id), bind it in a view model, and when the user presses submit, you add that model to a collection, save it, and create a new model which rebinds with the existing view model.

I've never needed this because I typically spawn views through my routing solution, but for a static page, it might be useful...does anyone have a need for this?

PS. we could to the same swappability for collections and CollectionSyncs, but because collections are dynamic by nature if you for example use the backbone-couch (https://github.com/janmonschke/backbone-couchdb) plus you can always change the url query parameters and re-fetch the collection which will just work. If someone has a use case, let me know.