Reputation: 1383
I've tried "didInsertElement" but that didn't seem to work, the markup doesn't exist and then the jQuery plugin code executes too fast.
Upvotes: 2
Views: 936
Reputation: 6409
Make sure you're using the inbuilt jQuery selector on the view - this.$() - that will work even if the element hasn't been inserted yet.
didInsertElement: function() {
this.$().jQueryPlugin();
}
Upvotes: 3
Reputation: 6309
Would you provide a jsFiddle of your issue? Also, try doing:
didInsertElement: function() {
Ember.run.next(optionalContext, function() {
// Your code here
});
}
That will run your code at the end of the current runloop which should guarantee that all rendering and bindings have executed.
But please provide a jsFiddle so a more precise answer can be given.
Upvotes: 4