Wijmo UI for the Web
complete Event
jQuery Event object
An object that contains the file info.
Fires when file upload is complete.
Syntax
Javascript (Usage) 
var instance; // Type: options
instance.complete = function(e, data) { };
Javascript (Specification) 
complete = function ( 
   e : jQuery.Event,
   data : object
) { };

Parameters

e
jQuery Event object
data
An object that contains the file info.
Example
In this example, the "complete" and "upload" client-side events are used to show the selected file in an Image control when the image file is uploaded.
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
     
   <%--Add an Image control to the page.--%>
    <asp:Image ID="Image1" runat="server" />
 
   <%--Raise the "complete" and "upload" client-side events and set the maximum number of files to upload to 1.--%>
    <wijmo:C1Upload ID="C1Upload1" runat="server" OnClientComplete="complete"
        OnClientUpload="upload" width="300px" MaximumFiles="1" />
     
         <script type="text/javascript">
             var ImageSrc = "";
 
             // Before upload, the image is set to the file that is saved in the TargetFolder "UploadedFiles" once upload is complete.  
             function upload(e, args) {
                 ImageSrc = "UploadedFiles/" + args[0].files[0].name;
             }
 
             // Once upload is complete, the image file saved in the TargetFolder appears in the Image control.
             function complete(e, args) {
                 $("#<%=Image1.ClientID %>").attr("src", ImageSrc);
             }                
    </script>
</asp:Content>

See Also

Reference

options type

 

 


© 2013 All Rights Reserved.

Send comments on this topic.