How do I run a function after an Ember View is inserted into the DOM?
Here’s my use-case: I’d like to use jQuery UI sortable to allow sorting.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to override
didInsertElementas it’s “Called when the element of the view has been inserted into the DOM. Override this function to do any set up that requires an element in the document body.”Inside the
didInsertElementcallback, you can usethis.$()to get a jQuery object for the view’s element.Reference: https://github.com/emberjs/ember.js/blob/master/packages/ember-views/lib/views/view.js