Bind ligercombobox Level 2 linkage in ligerui

Source: Internet
Author: User
$. Ajax ({URL: "hrhandler. ashx ", data:" Bz = getaskdata ", cache: false, type:" Post ", contenttype:" application/X-WWW-form-urlencoded; charset = UTF-8 ", success: function (data) {If (Data! = NULL) {// The generated type drop-down must be the Jason string var selectdata = eval (data); t34.setdata (selectdata); // For (VAR I = 0; I <selectdata. length; I ++) {// $ ("# textbox34 "). append ("<option value = '" + selectdata [I]. ID + "'>" + selectdata [I]. text + "</option>"); // }}, error: function () {f_alert ('failed', 'error ')}}); // when selecting a department, attach the second-level team to form a linkage $ ("# textbox34 "). change (function () {var departid = ""; $ ("# textbox34 "). ligercombobox ({width: boxwidth, onselected: function (newvalue) {departid = newvalue; $. ajax ({URL: "hrhandler. ashx ", data:" Bz = getgroupdata & departid = "+ departid, cache: false, type:" Post ", contenttype:" application/X-WWW-form-urlencoded; charset = UTF-8 ", success: function (data) {var A =" [{'id': '', 'text':''}] "; t35.setdata (eval (a); var selectdata = eval (data); t35.setdata (selectdata) ;}, error: function (){}})}});});
// Link the Department data to dropdownlist case "getmediadata": datatable dt = Edu. dbutility. dbhelpersql. getdatatable ("select departed_ I, departname_n from departmenteng"); // stringbuilder ST = new stringbuilder (); // foreach (datarow DR in DT. rows) // {// st. append ("<option value = \" "+ Dr [" departed_ I "]. tostring () + "\"> "+ Dr [" departname_n "]. tostring () + "</option> \ n"); //} string griddata = Edu. common. publicmethod. getselectjson (DT); griddata = griddata. replace ("departname_n", "text"); griddata = griddata. replace ("departed_ I", "ID"); context. response. write (griddata); break; // link the team data under the department to dropdownlist case "getgroupdata": datatable dtgroup = Edu. dbutility. dbhelpersql. getdatatable ("select G. group_ I, G. groupname_n from [groupseng] G left join [departmenteng] D on G. departid_ I = D. departed_ I where D. departed_ I = "+ context. request. params ["departid"]); // stringbuilder stgroup = new stringbuilder (); // foreach (datarow DR in dtgroup. rows) // {// stgroup. append ("<option value = \" "+ Dr [" group_ I "]. tostring () + "\"> "+ Dr [" groupname_n "]. tostring () + "</option> \ n"); //} // context. response. write (stgroup. tostring (); string griddatag = Edu. common. publicmethod. getselectjson (dtgroup); griddatag = griddatag. replace ("groupname_n", "text"); griddatag = griddatag. replace ("group_ I", "ID"); context. response. write (griddatag); break;

 

Bind ligercombobox Level 2 linkage in ligerui

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.