sandreas
sandreas

Reputation: 176

Wrapping bootstrap / jquery widgets with ember.js and ember easyform

I'm trying to implement some widgets (Multiselect and Datetimepicker) in my ember.js application. Not reinventing the wheel, i would prefer existing widgets that work well in bootstrap context but they don't in emberjs / easyForm.

I created a jsbin sample for multiselect, which works partially, but it is not displaying the element-list onclick. If manually add a css (see commented line), the list is displayed correctly but events are not handled by ember.

Could somebody tell me, what is wrong with it?

Upvotes: 2

Views: 546

Answers (1)

pbatey
pbatey

Reputation: 1441

I'm not familiar with EasyForm so I'm not sure this would work for you, but I created a component and helper to wrap multiselect:

Ember.BootstrapMultiselect = Ember.Select.extend({
  multiple:true,
  didInsertElement: function () {
    this.$().multiselect(this.get('options'));
  },
  onSelectionChanged: Ember.observer('selection', function () {
    this.$().multiselect('rebuild');
  })
});
Ember.Handlebars.helper('bootstrap-multiselect', Ember.BootstrapMultiselect);

Upvotes: 1

Related Questions