Vs2013+mvc3.0+easyui's ComboBox linkage use (ii)

Source: Internet
Author: User

Vs2013+mvc3.0+easyui's ComboBox linkage use (ii)

Introduction: use MVC3.0 in vs2013 (. net4.0) for the linkage of the ComboBox in Easyui,

Loading the ComboBox data, and realizing the linkage effect,

This article uses the date control in Easyui to achieve a linkage effect with the ComboBox,

--------------------------------------------------------------------------------------------------------------- --------------------------------------

The following shows the code of 3 practical modules:

Controller (Control):

    <summary>/////////</summary>///<param Name= "Strdate" > Date based on user selected date </param> <returns></returns>//<remarks> creator (DATE): ★ Pengzhen ★ (141016 11:24) </remarks> public jsonre      Sult getsendbillcodebydate (String strdate) {Isale_outerlistservice ser = sale_outerlistservice.instance; String json = string.      Empty; try {//Get available courier company Information for DataSet ds = Ser.        Getsendbillcodebydate (Strdate, userhelper.userinfo.storageids[0]); System.Data.DataTable dt = ds.        Tables[0]; if (ds! = null && ds. Tables.count > 0) {dt = ds.        Tables[0];        } else {return JSON (JSON); } if (dt! = null && dt.          Rows.Count > 0) {list<dynamic> List = new list<dynamic> (); foreach (System.Data.DataRow dr in Dt. Rows) {list. Add (New {ID = dr["Sendbill_code"]. GetstrING (), Name = dr["Sendbill_code"].          GetString ()}); //2 isolated data to json JSON = list.        Tojsonserialize ();        } else {return JSON (JSON); }} catch (Exception ex) {json = string.      Empty;    }//3 Output return JSON (JSON); }

--------------------------------------------------------------------------------------------------------------- --------------------------------------

Pub (page):

    <TD style= "width:50px;" class= "Tbl-label" > Date </td>    <td style= "width:150px;" class= "Tbl-value" >      <input id= "dtsendbilldate" type= "text" class= "Inp-normal"/>    </td>    <td class= " Tbl-label "> Shipping number </td>    <td class=" Tbl-value ">      <input type=" text "id=" Sendbill_code "Name=" Sendbill_code "class=" Inp-normal "/>    </td>

--------------------------------------------------------------------------------------------------------------- --------------------------------------

Biz (JS):

<script language= "JavaScript" > $ (function () {//Generate Easyui Datetimebox $ (' #dtSendBillDate '). Datebox ({req        Uired:true, onselect:function (date) {var year = Date.getfullyear (). toString (); var month = (Date.getmonth () + 1). toString (). length = = 1?        "0" + (date.getmonth () + 1). ToString (): (Date.getmonth () + 1). ToString (); var day = (Date.getdate (). toString ()). length = = 1?        "0" + date.getdate (). ToString (): Date.getdate (). ToString ();         var selectdate = year + month + day;      Loduphelper.getsendbillcodelist (selectdate);  }    }); Lodup Help class var loduphelper = {getsendbillcodelisturl: "/pack/getsendbillcodebydate",//Get issue number group Getsendbillcode List:function (selectdate) {Loduphelper.ajaxasync (Loduphelper.getsendbillcodelisturl, {strdate:selectdate}, func        tion (data) {Datasetcode = eval ("(" + Data + ")"); Comboboxcode = {valuefield: ' ID ', TextField: ' Name ', Data:datasetcode,         Required:true, Editable:false};      $ (' #SendBill_Code '). ComboBox (Comboboxcode);    });  }   }; });</script>



Vs2013+mvc3.0+easyui's ComboBox linkage use (ii)

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.