首頁  >  文章  >  web前端  >  Jquery中LigerUi的彈出編輯框(實作方法)_jquery

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

WBOY
WBOY原創
2016-05-16 17:29:241635瀏覽

一、載入

複製程式碼程式碼如下:


程式碼如下:



程式碼如下:



程式碼如下:



程式碼如下:


程式碼如下:
程式碼如下:程式碼如下:


程式碼
   
          
    ;
     
    ;                   ;     ;    
二、Html 複製程式碼程式碼如下:程式碼如下:程式碼如下:程式碼如下:程式碼如下:
   三、在新增中加入事件複製程式碼程式碼如下:

      //工具列事件
      function toolbarBtnItemClick(item) {
        case "add":
                  addbill({}, true, '新增記錄', false);
                  break;
              var selected = grid.getSelected();
                  if (!selected) { LG.tip('請選擇行!' ); return }
                            case "modify":
                 含 if (!selected) { LG.tip('請選擇行!'); return }
                  addbill(selected, false, '修改記錄', f    break;
              case "delete":
                  jQuery.ligerDialog.confirm('確定刪除嗎?', function (confirm) {                          f_delete();
               break;
          }
      }



四、在函數下面,加上彈出框樣式碼






程式碼如下:

      varDetailWin = null, currentData = null, currentIsAddNew, currentIsView;
     🎜>          currentIsAddNew = isAddNew;
currentIsView = isview;
          if (detailWin) {
             .show();
          }
          其他
      // 投入彈出視窗樣式內容
          }
          if (!isAddNew) {
  }
              $("#ProtId2").val(currentData.ProductName);
                     $("#ForId2").val( currentData.FormatName);
              $("#Foad1").val(currentData.FormatId);
      >              $("#Degrd1" ).val(currentData.DegreeId);
              $("#A#").val(currentData.AppendBill);              $( "#Maate").val(currentData.MadeDate);
              $("#BottleNum").val(currentData BuyCompanyName);
              $("#BuyCoy1").val(currentData.BuyCompanyId);
                   $("#VarId1").val(currentData. VarietyId);
              $("#Handate").val(currentData.HandDate);
                    $("#Fact1"). val(currentData.FactoryId);
              $("#Froce2").val(currentData.FromPlaceName);          }
}



五、彈出窗口樣式中的內容





複製代碼


程式碼如下:

              var mainform = $("#EditForm");
              inputWidth: 150,
                  fields:                      { display: "倉庫", name: "Daihao1", newline: true, labelWidth: 100, width: 150, space: 30 , type: "text", validate: { required: true, digits: true} },
                   00 , width: 150, space: 30, type: "select", option: {} },   // 彈出選擇框
                       : false, labelWidth: 100, width: 150, space: 30, type: "select", options: { valueFieldID: "DegreeId1", treeLeafOnly: false, tree: { url: "DegreeId1", treeLeafOnly: false, tree: { url: "../handle/ajase1.電話> validate : { required: true} },
                    { display: "備註", name: "mark", newline: false, labelWidth: "備註", name: "mark", newline: false, labelWidth: 10, wate, 5,0,0,53, l d : true, digits: true} }
         ],
                
              $.metadata.setType("attr", "validate");
         validate(mainform, { debug: true });
              $("#HandDate").val(currentdate);              $.ligerui.get(”      $.ligerui.get("Buyany2 ").set('onBeforeOpen', f_selectFary_2)
              $.ligerui.get("Froce2").set( tailWin = $.ligerDialog.open({
                  target: $("#Editdetail"),
                  width: 595, height: 460, top: 80, title: "新增保存修改     buttons: [
                  { text: '保存' , onclick: function () { save(); } },
                  { text: '取消,        ]
              });



六、保存事件


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn