Open j6er8er opened 10 years ago
I got this working by adding an observer to 'selectedAction' like so:
editButtonClicked : function() { var sel = this.get('selectedAction'); if(Ember.isNone(sel)) return; this.send(sel.clicked) }.observes('selectedAction'),
@j6er8er I'll check but you can just observes the selected
property instead of setting all buttons click events.
I can't get any clicks from button group buttons to trigger my controllers action.
In my template: {{ bs-btn-group size="1g" contentBinding="buttons" selectedBinding="selectedAction" }}
in my controller: buttons : [ Ember.Object.create({title: 'Create', type: 'primary', small: true, clicked:'editButtonClicked'}), Ember.Object.create({title: 'Delete', type: 'danger',small: true}), Ember.Object.create({title: 'Save', type: 'success',small: true})], actions : { editButtonClicked : function() { console.log("clicked!!!"); }
I can get regular buttons to work and when I look at the ember-debugger, they show up as a bsButton object whereas my button group buttons are just a plain old object.