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

Complete/Error callbacks are not firing

2 Answers 170 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 07 Dec 2011, 03:48 PM
Hello,
I am evaluating the kendoUpload widget. Everything works fine, my file is submitted, however when the upload is complete, my client events don't seem to get fired, or I have something configured improperly. Also of note, if I set autoUpload: false, then the upload files button does not start the upload. Below is what I have for configuration:

div.find('input:file').kendoUpload({
                async: {
                    saveUrl: '/SomeController/Action',
                    autoUpload: true
                },
                localization: {
                    "uploadSelectedFiles""Upload Logo" // TODO: load language specific text
                },
                multiple: false,
                remove: function (files) {
                    var previewElement = $('#' + item.Uid + 'prev');
                    previewElement.fadeOut('fast'function () {
                        previewElement.html('');
                    });
                },
                select: function (files) {
 
                    if ((window.File && window.FileReader && window.FileList && window.Blob)) {
                        if (files.files.length && files.files.length > 0) {
                            var file = files.files[0];
 
                            var previewElement = $('#' + item.Uid + 'prev');
                            previewElement.previewImage({
                                'file': file.rawFile,
                                'height': 250,
                                'width': 250,
                                'title''Some Logo'
                            });
                        }
                    }
                },
                upload: function (evt) {
                    evt.data = { 'Uid': item.Uid };
                },
                complete: function (evt) {
                    alert('complete');
                },
                success: function (evt) {
		alert('success');
                    if (evt.operation == 'upload') {                         var responseData = evt.response;                         alert(responseData);                     }                 }
Here is the response as seen in the fiddler tool:
HTTP/1.1 200 OK
Cache-Control: private
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 07 Dec 2011 14:45:13 GMT
Content-Length: 0

Any help would be appreciated.
Thanks,
ian

2 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 08 Dec 2011, 03:58 PM
Hello Ian,

I've tried out your code by adding stubs for the missing references and it seems to work fine.

What are the chances  that you're getting a JavaScript error of some kind?

Also, check that you're including the jQuery and KendoUI scripts in the right order. Similar behavior can occur if you include jQuery twice.

Kind regards,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ian
Top achievements
Rank 1
answered on 13 Dec 2011, 03:52 PM
Thanks for your help. This was actually caused by including an out dated version of the jquery.validate script.
ian
Tags
Upload
Asked by
Ian
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Ian
Top achievements
Rank 1
Share this question
or