0

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.

m0c
  • 2,180
  • 26
  • 45

2 Answers2

1

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?

mavilein
  • 11,648
  • 4
  • 43
  • 48
  • Thanks in your example everything is working. I found the issue, it was somethong totally else (and also slightly emberassing) – m0c Mar 29 '14 at 22:59
0

The issue was in my css, (I am still searching where it is coming from, but the reason why my checkboxes (doesn't matter which kind) are not rendered:

@media -sass-debug-info{filename{font-family:file\:\/\/\/Users\/marc\/Sites\/ember\/app\/styles\/style\.scss}line{font-family:\00003607}} input[type="checkbox"] { display: none; }

I know it hints where it is coming from, but its hidden in scss imports, It might be foundation or font-awesome or somethign like that.

m0c
  • 2,180
  • 26
  • 45