萬盛學電腦網

 萬盛學電腦網 >> 腳本專題 >> javascript >> Jquery中LigerUi的彈出編輯框(實現方法)

Jquery中LigerUi的彈出編輯框(實現方法)

本篇文章是對Jquery中LigerUi的彈出編輯框的實現方法進行了分析介紹,需要的朋友可以參考下  

一、載入

復制代碼 代碼如下:
    <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":
                  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);
          &nb
copyright © 萬盛學電腦網 all rights reserved