I. jquery wbox-lightweight pop-up window jQuery plug-in, which is only 3.65Kb after compression and developed based on jQuery1.4.2.
The pop-up box shows the effect and adds a lot of interesting functions, such as the callback function, display the hidden layer, Ajax page, and iframe embedding.
Page (for more information: http://www.js8.in/wbox)
$ ("# Selectuser"). wBox ({
IframeWH: {width: 800
},
RequestType: "iframe", // This example is used in iframe
Title: "select a driver ",
Target: "url"
});
2. Upload a value from the pop-up window page to the parent form and register the double-click event on the tab.
<A href = "javascript: void (0)" id = "Driver. UserId" ondblclick = "selectDriverName ('$!
{Driver. UserId} ',' $! {Driver. username} ') ">$! {Driver. username} </a>
<Script type = "text/javascript">
Function selectDriverName (uid, dname ){
// Pass userid and driver name to the parent form
Parent. jQuery ("# UserId"). val (uid );
Parent. jQuery ("# DriverName"). val (dname );
Parent. $ ("# wBox"). contents (). find ('. wBox_close'). click ();
}
</Script>
Note: Before wbox is disabled, you can pass the parameter to the parent page through parent. $ ("# pname "). val ($ ("# name "). val (), if yes
The new one includes the primary key. You need to create it in the background and then call the method in the view of the parent page. After passing the parameter
Close wbox.
Controler + View Code
1
2 controler:
3 HQLHelper. Create (coll );
4 string a = "parent. parent. getFid ('"+ coll. c_ID.ToString () + "','" + coll. c_NAME + "'); parent. $ (\ "# wBox \"). contents (). find ('. wBox_close '). click ();";
5 JSHelper. Out ();
6
7 view:
8 <script type = "text/javascript">
9
10 // after adding a folder, return its id and bind the name to the drop-down list.
11 function GetFid (id, name)
12 {
13
14 $ ("# selectColl "). append ($ ("<option value =" + id + "selected = 'selected'>" + name + "</option> "));
15
16}
17