Convert an excel file to dataset. Implement fuzzy query and drop-down Association in jqgrid

Source: Internet
Author: User
Tags jqgrid

1. Recently, the excel upload function has been used in the project. There are many uploading methods on the Internet. Here, only the excel files used for conversion to dataset are sorted out:

                          DataSet ExecleDs( filenameurl, =  strConn =  +  + filenameurl + ;         OleDbConnection conn = =  OleDbDataAdapter(

It is worth noting that the table is a file name that does not have an extension after processing through System. IO. Path. GetFileNameWithoutExtension (filenameurl;

2. The project has similar requirements:

When jqgrid is added or modified, the related second-level unit information is obtained according to the order number obtained by fuzzy query. For details about the parameters of jqgrid, refer to (http://www.cnblogs.com/younggun/archive/2012/08/27/2657922.html). The specific implementation method is as follows:

{Name: "OrderNo", width: 130, editable: true, editrules: {required: true}, formoptions: {elmsuffix: ("<span style = 'color: red'> * </span> ")},
Editoptions: {dataInit: loadAutoCompleteTransportPlan }},

{Name: 'hiherauthoritycode', width: 100, editable: true, editrules: {required: true}, formoptions: {elmsuffix: ("<span style = 'color: red'> * </span> ")}, edittype: 'select', editoptions: {maxlength: 50, dataUrl :""}},

OrderNo is the order number and HigherAuthorityCode is the second-level unit. The cascade control method is as follows:

, Change: function (e) {// change event
TypeCode = document. getElementById (typeCode = | typeCode =: document. getElementById (strhcode = "" $. ajax ({url: data: (I =; I <data. length; I ++ (I! = Length-1 strhcode + = "<option>" + data [I]. HigherAuthorityCode + "</option> ;"}
Strhcode + = "<option>" + data [I]. HigherAuthorityCode + "</option> "}
// Document. getElementById (). value = higherAuthoritycode = $ ("select # HigherAuthorityCode"); higherAuthoritycode. append (strhcode );
}
})};


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.