复制代码 代码如下:
<link href="https://www.jb51.net/lib/ligerUI/skins/Aqua/css/ligerui-all.css" type="text/css" />
<script src="https://www.jb51.net/lib/jquery/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="https://www.jb51.net/lib/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="https://www.jb51.net/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>
<script src="https://www.jb51.net/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
<link href="https://www.jb51.net/lib/css/common.css" type="text/css" />
<script src="https://www.jb51.net/lib/js/common.js" type="text/javascript"></script>
<script src="https://www.jb51.net/lib/js/LG.js" type="text/javascript"></script>
<script src="https://www.jb51.net/lib/jquery-validation/jquery.validate.min.js" type="text/javascript"></script>
<script src="https://www.jb51.net/lib/jquery-validation/jquery.metadata.js" type="text/javascript"></script>
<script src="https://www.jb51.net/lib/jquery-validation/messages_cn.js" type="text/javascript"></script>
<script src="https://www.jb51.net/lib/js/ligerui.expand.js" type="text/javascript"></script>
<script src="" type="text/javascript"></script>
二、Html
复制代码 代码如下:
<div><form method="post"></form> </div> <%--弹出编辑框DIV--%>
三、在Add中添加事件
复制代码 代码如下:
//工具条事件
function toolbarBtnItemClick(item) {
switch (item.id) {
case "add":
addbill({}, true, '添加记录', false);
break;
case "view":
var selected = grid.getSelected();
if (!selected) { LG.tip('请选择行!'); return }
addbill(selected, false, '查看记录', true);
break;
case "modify":
var selected = grid.getSelected();
if (!selected) { LG.tip('请选择行!'); return }
addbill(selected, false, '修改记录', false);
break;
case "delete":
jQuery.ligerDialog.confirm('确定删除吗?', function (confirm) {
if (confirm)
f_delete();
});
break;
}
}
四、在函数下面,添加弹出框样式代码
复制代码 代码如下:
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
{
// 放入弹出窗口样式内容
}
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);
}
}
五、弹出窗口样式中的内容
复制代码 代码如下: