一、载入
复制代码 代码如下:
    <link href="../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script src="/UploadFiles/2021-04-02/jquery-1.5.2.min.js">    <script src="../lib/ligerUI/js/ligerui.min.js">    <script src="/UploadFiles/2021-04-02/ligerForm.js">    <script src="../lib/ligerUI/js/plugins/ligerGrid.js">    <link href="../lib/css/common.css" rel="stylesheet" type="text/css" /> 
    <script src="/UploadFiles/2021-04-02/common.js">    <script src="../lib/js/LG.js">    <script src="/UploadFiles/2021-04-02/jquery.validate.min.js">    <script src="../lib/jquery-validation/jquery.metadata.js">    <script src="/UploadFiles/2021-04-02/messages_cn.js">    <script src="../lib/js/ligerui.expand.js">    <script src="/UploadFiles/2021-04-02/ligerDateEditor.js">
二、Html
复制代码 代码如下:
<div id="Editdetail" style="display:none;"><form id="EditForm" method="post"></form> </div> &nbsp; &nbsp;<%--弹出编辑框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);
          }
      }

五、弹出窗口样式中的内容
复制代码 代码如下:
              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,LigerUi,编辑框

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
评论“Jquery中LigerUi的弹出编辑框(实现方法)”
暂无“Jquery中LigerUi的弹出编辑框(实现方法)”评论...

P70系列延期,华为新旗舰将在下月发布

3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。

而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?

根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。