javascript

位置:IT落伍者 >> javascript >> 浏览文章

Jquery中LigerUi的弹出编辑框(实现方法)


发布日期:2021年12月10日
 
Jquery中LigerUi的弹出编辑框(实现方法)
本篇文章是对Jquery中LigerUi的弹出编辑框的实现方法进行了分析介绍需要的朋友可以参考下

载入

复制代码 代码如下:
<link href="/lib/ligerUI/skins/Aqua/css/ligeruiallcss" rel="stylesheet" type="text/css" />
<script src="/lib/jquery/jqueryminjs" type="text/javascript"></script>
<script src="/lib/ligerUI/js/ligeruiminjs" type="text/javascript"></script>
<script src="/lib/ligerUI/js/plugins/ligerFormjs" type="text/javascript"></script>
<script src="/lib/ligerUI/js/plugins/ligerGridjs" type="text/javascript"></script>
<link href="/lib/css/commoncss" rel="stylesheet" type="text/css" />
<script src="/lib/js/commonjs" type="text/javascript"></script>
<script src="/lib/js/LGjs" type="text/javascript"></script>
<script src="/lib/jqueryvalidation/jqueryvalidateminjs" type="text/javascript"></script>
<script src="/lib/jqueryvalidation/jquerymetadatajs" type="text/javascript"></script>
<script src="/lib/jqueryvalidation/messages_cnjs" type="text/javascript"></script>
<script src="/lib/js/ligeruiexpandjs" type="text/javascript"></script>
<script src="//lib/ligerUI/js/plugins/ligerDateEditorjs" type="text/javascript"></script>


Html

复制代码 代码如下:
<div  id="Editdetail" style="display:none;"><form id="EditForm"  method="post"></form> </div>  <%弹出编辑框DIV%>


在Add中添加事件

复制代码 代码如下:
//工具条事件
function toolbarBtnItemClick(item) {
switch (itemid) {
case "add":
addbill({} true 添加记录 false);
break;
case "view":
var selected = gridgetSelected();
if (!selected) { LGtip(请选择行!); return }
addbill(selected false 查看记录 true);
break;
case "modify":
var selected = gridgetSelected();
if (!selected) { LGtip(请选择行!); return }
addbill(selected false 修改记录 false);
break;
case "delete":
jQueryligerDialogconfirm(确定删除吗? 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) {
detailWinset(title t);
detailWinshow();
}
else
{
// 放入弹出窗口样式内容
}
if (!isAddNew) {
// public int LrId { get; set; }
$("#ProtId")val(currentDataProductName);
$("#ProId")val(currentDataProductId);
$("#ForId")val(currentDataFormatName);
$("#Foad")val(currentDataFormatId);
$("#Ded")val(currentDataDegreeName);
$("#Degrd")val(currentDataDegreeId);
$("#Appl")val(currentDataAppendBill);
$("#Bum")val(currentDataBoxNum);
$("#Maate")val(currentDataMadeDate);
$("#BottleNum")val(currentDataBottleNum);
$("#Bumpany")val(currentDataBuyCompanyName);
$("#BuyCoy")val(currentDataBuyCompanyId);
$("#VayId")val(currentDataVarietyName);
$("#VarId")val(currentDataVarietyId);
$("#Handate")val(currentDataHandDate);
$("#Fact")val(currentDataFactoryName);
$("#Fact")val(currentDataFactoryId);
$("#Froce")val(currentDataFromPlaceName);
$("#Froce")val(currentDataFromPlaceId);
}
}


弹出窗口样式中的内容

复制代码 代码如下:
var mainform = $("#EditForm");
mainformligerForm({
inputWidth:
fields:
[
{ name: "ProId" type: "hidden" } // 隐藏字段为弹出选择编号保存值
  { display: "仓库" name: "Daihao" newline: true labelWidth:   width: space: type: "text" validate: { required: true digits:  true} }
{ display: "商品名称" name: "ProId"  comboboxName: "ProId" newline: false labelWidth: width:   space: type: "select" option: {} } // 弹出选择框
  { display: "单位" name: "DegreeId" comboboxName: "DegreeId" newline:  false labelWidth: width: space: type: "select" options: {  valueFieldID: "DegreeId" treeLeafOnly: false tree: { url:  "/handle/seashx?ajaxaction=Getgree" checkbox: false}} }
  { display: "生产日期" name: "MadeDate" newline: true labelWidth:   width: space: type: "date" validate: { required: true} }
  { display: "备注" name: "mark" newline: false labelWidth: width:   space: type: "text" validate: { required: true digits: true} }
]
toJSON: JSONstringify
});
$metadatasetType("attr" "validate");
LGvalidate(mainform { debug: true });
$("#HandDate")val(currentdate);
$("#BoNum")val("");
$ligeruiget("ProId")set(onBeforeOpen f_selectCoct)
$ligeruiget("Faory")set(onBeforeOpen f_selectFary_)
$ligeruiget("Buyany")set(onBeforeOpen f_selectFary_)
$ligeruiget("Froce")set(onBeforeOpen f_selectFroace)
detailWin = $ligerDialogopen({
target: $("#Editdetail")
width: height: top: title: "添加保存修改窗口" //
buttons: [
{ text: 保存 onclick: function () { save(); } }
{ text: 取消 onclick: function () { detailWinhide(); } }
]
});


保存事件

               

上一篇:js为鼠标添加右击事件防止默认的右击菜单弹出

下一篇:javascript获取下拉列表框当中的文本值示例代码