Home  >  Article  >  Web Front-end  >  How to analyze Jquery's LigerUI to implement file upload_jquery

How to analyze Jquery's LigerUI to implement file upload_jquery

WBOY
WBOYOriginal
2016-05-16 17:29:191345browse
1. Add
to Head
< ;script src="../lib/js/ligerui.expand.js" type="text/javascript">
2. Div code in Html
Copy code The code is as follows:





3. In Js - what is written is the key part. Friends who know LigerUI - you know

1. Add an item [save address field] to the grid
{ display: "Scan", name: "AppendBillPath", width: 120, type: "text", align: "left" }
2. Form can add items [save address and pop-up selection box]
                                                                                                                                                                                                                         AppendBillPath", comboboxName: "AppendBillPath2", newline: true, labelWidth: 100, width: 150, space: 30, type: "select", options: {}} // --Upload-[6]--
$.ligerui.get("AppendBillPath2").set('onBeforeOpen', f_selectAppendBillPath_1) // [Scanned copy] // --Upload-[7]--
3. Event

// #region ======================================= [Upload scanned document window] // --Upload-[8]--


Copy code
The code is as follows:

var AppendBillPathDetail = null;
function f_selectAppendBillPath_1() {
var imageurl = $("#AppendBill").val();
var AppendBill_Id = $("#AppendBill") .val(); // Order number
    if (imageurl.length == 0) {
     LG.showError("You did not enter the order number, please enter the tracking number!");
                                                                                                                       else {
                                                                      
                                                                                                                           ,,,,,,,,,,,,, buttons: [
                                                                                                                                                                                                 ]
                                                                          ;
                           // var filehelpcode = $("#filehelpcode").val();
var extend = imgurl.substring(imgurl.lastIndexOf("."), imgurl.length);
extend = extend.toLowerCase();
        if (extend == ".jpg" || extend == ".jpeg" || extend == ".png" || extend == ".gif" || extend == ".bmp")
                                                                                                                                                                                                                                                                                                                  return;
        }
var imageurl = $("#AppendBill").val(); // extend
alert(imageurl);
$.ajaxFileUpload({
        url: "../handle/ImageUpload.aspx ?imageurl=" imageurl, // --Upload-[9]-- aspx file
secureuri: false,
fileElementId: "fileupload", //Input file id
dataType: "text",
                                                                                                                                                                                                                                              ​").val(Data);

LG.tip(data);
f_reload();
},
error: function (data, status , e) {
LG.showError(data);
                                                                                 ; Server.MapPath("/Image/" gfilename filenameext); // Perform upload operation
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn