-
Notifications
You must be signed in to change notification settings - Fork 176
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
bind the model with backbone variable #301
Comments
You would rather control this in your View. bindings: {
'#uRepeateverybyweek': {
observe: 'uRepeateverybyweek',
onGet: function(val) {
var displayMode = val ? 'inline-block' : 'none';
this.$('#uRepeateverybyweek').css('display', displayMode);
}
}
} |
Hi David, i have tried above code with below HTML but is giving me.
Repeat every:
1
2
3
4
5
weeks
Resultant: true
On Sat, Dec 26, 2015 at 9:45 PM, David Skx [email protected] wrote:
Kartik*Python | Django | AngularJS Developer * |
@kdbusiness90 you can remove your var MyView = Backbone.View.extend({
template: _.template('#my_template'),
render(){
this.$el.html(this.template(this.model.toJSON())); // Only pass in serialized Model.
return this;
},
bindings: {
'#uRepeateverybyweek': {
observe: 'uRepeateverybyweek',
update: false, // Don't try to update this element, only make it
visible(val, options){ return val } // visible depending on `uRepeateverybyweek` attribute
}
}
}); |
Hi All,
How do i bind the model with backbone variable like
In Html:
elements.attributes.uRepeateverybyweek is not working ? with backbone.stickit
The text was updated successfully, but these errors were encountered: