I. Loading
Copy codeThe Code is as follows:
<Link href = "../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel = "stylesheet" type = "text/css"/>
<Script src = ".../lib/jquery/jquery-1.5.2.min.js" type = "text/javascript"> </script>
<Script src = "../lib/ligerUI/js/ligerui. min. js" type = "text/javascript"> </script>
<Script src = "../lib/ligerUI/js/plugins/ligerForm. js" type = "text/javascript"> </script>
<Script src = "../lib/ligerUI/js/plugins/ligerGrid. js" type = "text/javascript"> </script>
<Link href = "../lib/css/common.css" rel = "stylesheet" type = "text/css"/>
<Script src = "../lib/js/common. js" type = "text/javascript"> </script>
<Script src = "../lib/js/LG. js" type = "text/javascript"> </script>
<Script src = "../lib/jquery-validation/jquery. validate. min. js" type = "text/javascript"> </script>
<Script src = "../lib/jquery-validation/jquery. metadata. js" type = "text/javascript"> </script>
<Script src = "../lib/jquery-validation/messages_cn.js" type = "text/javascript"> </script>
<Script src = "../lib/js/ligerui. expand. js" type = "text/javascript"> </script>
<Script src = ".../../lib/ligerUI/js/plugins/ligerDateEditor. js" type = "text/javascript"> </script>
Ii. Html
Copy codeThe Code is as follows:
<Div id = "Editdetail" style = "display: none; "> <form id =" EditForm "method =" post "> </form> </div> <% -- the edit box DIV -- %> is displayed.
3. Add events in Add
Copy codeThe Code is as follows:
// Tool bar event
Function toolbarBtnItemClick (item ){
Switch (item. id ){
Case "add ":
Addbill ({}, true, 'add record ', false );
Break;
Case "view ":
Var selected = grid. getSelected ();
If (! Selected) {LG. tip ('select a row! '); Return}
Addbill (selected, false, 'view record ', true );
Break;
Case "modify ":
Var selected = grid. getSelected ();
If (! Selected) {LG. tip ('select a row! '); Return}
Addbill (selected, false, 'modify record ', false );
Break;
Case "delete ":
JQuery. ligerDialog. confirm ('Are you sure you want to delete it? ', Function (confirm ){
If (confirm)
F_delete ();
});
Break;
}
}
4. Add the pop-up box style code under the Function
Copy codeThe Code is as follows:
Var detailWin = null, currentData = null, currentIsAddNew, currentIsView;
Function addbill (data, isAddNew, t, isview ){
CurrentData = data;
CurrentIsAddNew = isAddNew;
CurrentIsView = isview;
If (detailWin ){
DetailWin. set ('title', t );
DetailWin. show ();
}
Else
{
// Add the style content in the pop-up window
}
If (! IsAddNew ){
// Public int LrId {get; set ;}
$ ("# ProtId2"). val (currentData. ProductName );
$ ("# ProId1"). val (currentData. ProductId );
$ ("# ForId2"). val (currentData. FormatName );
$ ("# Foad1"). val (currentData. FormatId );
$ ("# Ded2"). val (currentData. DegreeName );
$ ("# Degrd1"). val (currentData. DegreeId );
$ ("# Appl"). val (currentData. AppendBill );
$ ("# Bum"). val (currentData. BoxNum );
$ ("# Maate"). val (currentData. MadeDate );
$ ("# BottleNum"). val (currentData. BottleNum );
$ ("# Bumpany2"). val (currentData. BuyCompanyName );
$ ("# BuyCoy1"). val (currentData. BuyCompanyId );
$ ("# VayId2"). val (currentData. VarietyName );
$ ("# VarId1"). val (currentData. VarietyId );
$ ("# Handate"). val (currentData. HandDate );
$ ("# Fact2"). val (currentData. FactoryName );
$ ("# Fact1"). val (currentData. FactoryId );
$ ("# Froce2"). val (currentData. FromPlaceName );
$ ("# Froce1"). val (currentData. FromPlaceId );
}
}
5. Content in the pop-up window style
Copy codeThe Code is as follows:
Var mainform =$ ("# EditForm ");
Mainform. ligerForm ({
InputWidth: 150,
Fields:
[
{Name: "ProId1", type: "hidden"}, // hide the field, and select the number to save for the pop-up.
{Display: "repository", name: "Daihao1", newline: true, labelWidth: 100, width: 150, space: 30, type: "text", validate: {required: true, digits: true }},
{Display: "item name", name: "ProId", comboboxName: "ProId2", newline: false, labelWidth: 100, width: 150, space: 30, type: "select", option :{}}, // The select box is displayed.
{Display: "unit", name: "DegreeId", comboboxName: "DegreeId2", newline: false, labelWidth: 100, width: 150, space: 30, type: "select", options: {valueFieldID: "DegreeId1", treeLeafOnly: false, tree: {url :".. /handle/se1.ashx? Ajaxaction = Getgree ", checkbox: false }}},
{Display: "production date", name: "MadeDate1", newline: true, labelWidth: 100, width: 150, space: 30, type: "date", validate: {required: true }},
{Display: "Remarks", name: "mark", newline: false, labelWidth: 100, width: 150, space: 30, type: "text", validate: {required: true, digits: true }}
],
ToJSON: JSON2.stringify
});
$. Metadata. setType ("attr", "validate ");
LG. validate (mainform, {debug: true });
$ ("# HandDate"). val (currentdate );
$ ("# BoNum"). val ("0 ");
$. Ligerui. get ("ProId2"). set ('onbeforeopen', f_selectCoct)
$. Ligerui. get ("Faory2"). set ('onbeforeopen', f_selectFary_1)
$. Ligerui. get ("Buyany2"). set ('onbeforeopen', f_selectFary_2)
$. Ligerui. get ("Froce2"). set ('onbeforeopen', f_selectFroace)
DetailWin = $. ligerDialog. open ({
Target: $ ("# Editdetail "),
Width: 595, height: 460, top: 80, title: "add SAVE modification window", // 240
Buttons :[
{Text: 'save', onclick: function () {save ();}},
{Text: 'cancel', onclick: function () {detailWin. hide ();}}
]
});
6. Save events