I am looking for a very simple example where e.g. there is a two way binding between span
text and an input
element using Backbone.js and Rivets.js. Perhaps there is one in the Rivets.js docs, but I can't find it. Any help please?
相关问题
- Backbone.js PushState routes .htaccess only workin
- Updating a LayoutView's Model
- Disable Backbone.js hashes entirely, but keep push
- Is there an easy way to distribute a Flask server
- React + Backbone, Target container is not a DOM el
相关文章
- Get all models in backbone collection where attrib
- How can I dynamically set a className for a Backbo
- Nesting Views within Views in backbone js
- Backbone-relational hasmany best practices
- JavaScript error: “is not a constructor”
- Marionette + i18n in templates
- Rendering reCAPTCHA v2.0 widget within Backbone vi
- Backbone.js PUT/DELETE problems with Codeigniter R
Assuming that you mean a two-way binding (model-to-view and view-to-model) on an input element and a one-way binding (model-to-view) on a span element, then the following view will do what you describe.
Here is a fiddle that demonstrates things in action. It includes a Backbone adapter on the
:
interface and shows how to bind a model to the view (this is just a more trivial example of what is already shown on the homepage).I recommend that you use: https://github.com/theironcook/Backbone.ModelBinder It can satisfy the two-way binding between the demand of all the view and model。
This is what I do nested view binding example: http://files.cnblogs.com/justinw/Nested_Model_bi_Binding.zip