Problems when integrate jquery plugins into emberjs app


#1

I want to integrate other jquery plugins into my ember app. I found some posts, like: http://www.lukemelia.com/blog/archives/2012/03/10/using-ember-js-with-jquery-ui/

It said that view’s didInsertElement() is the best place to initialize other plugins. I tried that way but result turned out to be different.

This event is fired when the view’s tag is rendered, but its inside #each child element is not rendered.

I made a demo page in jsbin to tell the problem. http://jsbin.com/ohodub/93

It is expected that in the page, a text of “selected elements: 1” should be displayed, but currently it is “selected elements: 0”

Please help me to solve this problem!


#2

Try tying in your jQuery logic to your views DOM instance (via this.$()). You can see an updated example here. Also, this link is bound to be useful to you.


#3

In the future, StackOverflow is a better place to ask these sorts of questions. Thanks!


#4