ember.jsember.js-view

Custom Checkbox is not rendered


I am trying to allow my user to create a group and invite his friends. I have already tried several ways, but its not really working out. My current approach looks something like this in the main template:

{{#each session.user.friends}}
    <li>{{view App.FriendSelectCheckbox userBinding='this' groupBinding='controller.content'}} {{nickName}}</li>
{{/each}}

And the custom view is defined like this: (the whole thing is basically from this JS-Fiddle: http://jsfiddle.net/durinthomas/cB3De/)

App.FriendSelectCheckbox = Ember.Checkbox.extend({
    checkedObserver: function(){
        if(this.get('checked'))
            this.get('group.users').addObject(this.get('user'));
        else
            this.get('group.users').removeObject(this.get('user'));
    }.observes('checked')
});

The problem is that the checkbox is not rendered. I know that there is usually a handlebars helper to render checkboxes or other built in views. But I thought this would be the approach to render just a view. And just for playing around I also tried to do {{view Ember.Checkbox}} which is not rendering a checkbox either.


Solution

  • The checkbox is successfully rendering for me: http://emberjs.jsbin.com/qazuj/1/edit?html,js,output The JSFiddle you linked uses an pre 1.0 version of Ember. Are you using latest?