This is a migrated thread and some comments may be shown as answers.

Angular drag and drop with upload

2 Answers 124 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
flexdev
Top achievements
Rank 1
flexdev asked on 20 Oct 2015, 08:18 PM

So based on this: http://demos.telerik.com/kendo-ui/upload/angular , I should be able to combine these, but cannot. Am using angular (not v2) and have basically went through this verbatim with no luck. I mean, I drag or select, and it does not show any files. My code in my view is:

 

                    <div class="de

<form>                   
    <div class="demo-section k-content" ng-controller="claimsController">
                        <div>
                            <h4>Upload files</h4>
                            <input name="files"
                                   type="file"
                                   kendo-upload
                                   k-async="{ saveUrl: 'save', removeUrl: 'remove', autoUpload: true }"
                                   k-select="onSelect"
                                   />
                        </div>
                        <div style="padding-top: 1em;">
                            <h4>Console</h4>
                            <div class="console"></div>
                        </div>
                    </div>
</form>

2 Answers, 1 is accepted

Sort by
0
flexdev
Top achievements
Rank 1
answered on 20 Oct 2015, 08:20 PM

Well that was quirky. To add to this, my controller code is:

    $scope.onSelect = function(e) {
                var message = $.map(e.files, function(file) { return file.name; }).join(", ");
                kendoConsole.log("event :: select (" + message + ")");
    };

Mind you, this controller also exists for other pieces and so what I am showing here is what I believe to be the scope for this action.

 

Thanks much.

0
T. Tsonev
Telerik team
answered on 23 Oct 2015, 10:56 AM
Hi,

Please accept my apologies for the delayed response.

I can't spot anything wrong with the code snippet.

You should omit the form, as that's not needed for asynchronous uploads.
Still, this shouldn't have any adverse effects.

Can you please check if you're getting any JavaScript errors?
I suspect that kendoConsole is undefined in your case as its part of the demos.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Drag and Drop
Asked by
flexdev
Top achievements
Rank 1
Answers by
flexdev
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or