Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

onOpen Event Fires, But Execution Halts
  • Hello, I am using the onOpen() event to show a progress message, but using this event, the onComplete() event never fires. As soon as I comment out the custom onOpen() event, works perfectly. Here is my code:


    $('#csv_import_routes_upload_form').uploadify({
    'uploader': '/Shared/Plugins/Uploadify/uploadify.swf',
    'script': '/Dispatch/Handlers/CSVUpload.ashx',
    'scriptData': { 'username': '<%= Session.Contents["USERNAME"].ToString() %>' },
    'cancelImg': '/Shared/Plugins/Uploadify/cancel.png',
    'folder': '/Dispatch/Uploads',
    'auto': true,
    'buttonText': 'Upload CSV File',
    'expressInstall': '/Shared/Plugins/Uploadify/expressInstall.swf',
    'fileExt': '*.csv',
    'fileDesc': '.csv',
    'multi': false,
    'sizeLimit': 500000,
    'scriptAccess': 'always',
    'removeCompleted': false,
    'onOpen': function (event, ID, fileObj) {
    $(".csv_import_routes_form").html("<div style=\"text-align: center; margin: 10px auto auto auto;\"><img src=\"/Shared/Css/Images/ajax_bar.gif\" /><br /><span style=\"font-weight: bold;\">Processing...</span></div>");
    },
    'onError': function (event, ID, fileObj, errorObj) {
    //Error
    $(".csv_import_routes_form").html("<div class=\"csv-error\">" + errorObj.info + "</div>");
    },
    'onComplete': function (event, ID, fileObj, response, data) {
    var result = JSON.parse(response);

    //Success
    if (typeof (result.error) == "undefined") {
    var html = "<div><span style=\"color: \">Successfully</span> imported <strong>" + result.data.number_inserted_routes + "</strong> routes.</div>";

    for (var i = 0; i < result.data.failed_stops.length; i++) {
    html += "<div>" + result.data.failed_stops[i].address + ", " + result.data.failed_stops[i].city + " " + result.data.failed_stops[i].state + " " + result.data.failed_stops[i].zip + " " + result.data.failed_stops[i].country + "</div>";
    }

    $(".csv_import_routes_form").html(html);
    }
    //Error
    else {
    $(".csv_import_routes_form").html("<div class=\"csv-error\">" + result.error + "</div>");
    }
    }
    });


    Thanks.
  • Bump, any ideas?
  • Final bump? This is driving me nuts, last polish I need to do.