Jquery中LigerUi的弹出编辑框(实现方法) - Web前端
作者:98wpeu发布时间:2026-08-06分类:网页前端技术浏览:15
一、载入
复制代码 代码如下:
<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>
二、html
复制代码 代码如下:
<div id="EditdetAIl" style="display:none;"><form id="EditForm" method="post"></form> </div> <%--弹出编辑框DIV--%>
三、在Add中添加事件
复制代码 代码如下:
//工具条事件
function toolbarBTnItemClick(item) {
switch (item.id) {
case "add":
addbill({}, true, '添加记录', false);
break;
case "view":
varselected = 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);
}
}
五、弹出窗口样式中的内容
复制代码 代码如下:
var mainform = $("#EditForm");
mainform.ligerForm({
inputwidth: 150,
fields:
[
{ name: "ProId1", type: "hidden" }, // 隐藏字段,为弹出选择编号保存值
{ display: "仓库", name: "Daihao1", newline: true, labelWidth: 100, width: 150, space: 30, type: "text", validate: { required: true, digits: true} },
{ display: "商品名称", name: "ProId", comboboxName: "ProId2", newline: false, labelWidth: 100, width: 150, space: 30, type: "select", option: {} }, // 弹出选择框
{ display: "单位", 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: "生产日期", name: "MadeDate1", newline: true, labelWidth: 100, width: 150, space: 30, type: "date", validate: { required: true} },
{ display: "备注", 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: "添加保存修改窗口", //240
buttons: [
{ text: '保存', onclick: function () { save(); } },
{ text: '取消', onclick: function () { detailWin.hide(); } }
]
});
六、保存事件
相关推荐
- JQuery获取样式中的background-color颜色值的问题 - Web前端
- 鼠标移到导航当前位置的LI变色处于选中状态 - Web前端
- 模拟多级复选框效果的jquery代码 - Web前端
- jquery indexOf使用方法 - Web前端
- jQuery的控件及事件(输入控件及回车事件)使用示例 - Web前端
- Jquery实现搜索框提示功能示例代码 - Web前端
- jQuery的控件及事件(输入控件及回车事件)使用示例 - Web前端
- cookie.js 加载顺序问题怎么才有效 - Web前端
- jquery弹出关闭遮罩层实例 - Web前端
- jquery用get实现ajax在ie里面刷新不进入后台解决方法 - Web前端
- 网页前端技术排行
-
- 1[Web前端]用javascript实现默认图片替代未显示的图片 - Web前端
- 2分析Iconfont-阿里巴巴矢量常用图标库 - Web前端
- 3jQuery实例教程:制作网页中可折叠的面板 - Web前端
- 4【第六章】Foundation之按钮和下拉功能 - Web前端
- 5基于jquery的滚动条滚动固定div(附演示下载) - Web前端
- 6jQuery编写widget的一些技巧分享 - Web前端
- 7分享精心挑选的12款优秀jQuery Ajax分页插件和教程 - Web前端
- 8jQuery实现鼠标移到元素上动态提示消息框效果 - Web前端
- 9在Mac/PC上远程调试iPhone/iPad上的网页 - Web前端
- 最近发表
-
- WordPress随机显示特色图片插件:Random Post Thumbnails
- KeePass实现Chrome浏览器自动填充密码方法一
- LNMP一键包nginx 301强制跳转到https教程
- KeePass实现Chrome浏览器自动填充密码方法二
- #建站# 免费的VPS管理软件Xshell8/Xftp8中文版下载
- 使用Xshell 8连接VPS教程_电脑登录vps的方法
- WordPress评论界面添加烟花????效果
- 不同浏览器书签同步方案:坚果云+Floccus_详细使用教程
- iOS端KeePassXC客户端APP:Strongbox Password Safe
- 给WordPress评论中的Gravatar头像图片添加ALT属性


