# Ember Views w/ jQuery Plugins and Ember Data

**URL:** <https://discuss.emberjs.com/t/ember-views-w-jquery-plugins-and-ember-data/4688>\
**Category:** Ember Data\
**Created:** [March 31, 2014, 3:13pm UTC](https://discuss.emberjs.com/t/ember-views-w-jquery-plugins-and-ember-data/4688 "2014-03-31T15:13:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlonlandaverd](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/marlonlandaverd/32/5545_2.png) [@marlonlandaverd](https://discuss.emberjs.com/u/marlonlandaverd)\
**Post date:** [March 31, 2014, 3:13pm UTC](https://discuss.emberjs.com/t/ember-views-w-jquery-plugins-and-ember-data/4688/1 "2014-03-31T15:13:29Z")

</div>

Hello Ember!

I have a calendar jQuery plugin that I’m wrapping in a view:

```
App.Calendar = Em.View.extend({
    didInsertElement: function(){
        // creation of plugin...
    }
});

```

This plugin needs an array of the events that I want rendered. The events are being loaded through Ember-Data.

How do I create this array of events?

The only way I’ve been able to solve this is through promises and Ember array functions:

```
this.get('controller.events').then(function(emEvents){
    var events = [];
    emEvents.map(function(item){
        var event = {
        "title": item.get("name"),
        "startTime": item.get("startTime"),
        "endTime": item.get("endTime")
        };
        events.push(event);
    });
    // create plugin with events array
});

```

I don’t know if this good Ember design or the way I should be doing it.

Also if I want data binding, how do I create that? (the calendar plugin allows the user to edit the events)
