Complete/Error callbacks are not firing

3 posts, 1 answers
  1. Ian
    Ian avatar
    21 posts
    Member since:
    Apr 2011

    Posted 07 Dec 2011 Link to this post

    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. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2831 posts

    Posted 08 Dec 2011 Link to this post

    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!
  3. Ian
    Ian avatar
    21 posts
    Member since:
    Apr 2011

    Posted 13 Dec 2011 Link to this post

    Thanks for your help. This was actually caused by including an out dated version of the jquery.validate script.
    ian
Back to Top