Question

I'm creatinga n app using Ember.js and Ineed to upload files in my app for that I've to use uplodify.js I know how to use uplodify.js in the traditional way but the problem is how can i use the uplodify.js in a app constructed by Ember.js. my current code is given below I know its not correct

Wizard = Em.Application.create({
    ready: function () {
        $('#logoUpload').uploadify({
            'swf': '/Assets/Uplodify/uploadify.swf',
            'uploader': 'Business/FileUpload',
            'buttonText': 'Upload new photo',
            'cancelImg': '/Assets/Uplodify/cancel.png'
        });
    }
});
Was it helpful?

Solution

You are making this call before anything has been rendered, hence the selector will fail if the #logoUpload is not directly on the page. You should create an upload view and then call this code in the didInsertElement function of the view.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top