Home  >  Article  >  Web Front-end  >  LigerUi pop-up edit box in Jquery (implementation method)_jquery

LigerUi pop-up edit box in Jquery (implementation method)_jquery

WBOY
WBOYOriginal
2016-05-16 17:29:241637browse

一、载入

复制代码 代码如下:

   
   
      
   
   
     
      
   
   
   
   
   
   

二、Html
复制代码 代码如下:

   <%--弹出编辑框DIV--%>

三、在Add中添加事件
复制代码 代码如下:

//Toolbar event
function toolbarBtnItemClick(item) {
switch (item.id) {
case "add":
addbill({} , true, 'Add record', false);
break;
case "view":
var selected = grid.getSelected();
if (!selected) { LG.tip('Please select a row!' ); return }
addbill(selected, false, 'View records', true);
break;
case "modify":
var selected = grid.getSelected();
                                        (!selected) { LG.tip('Please select a row!'); return }
                                                                                                                                                                                                                                                           🎜>               jQuery.ligerDialog.confirm('Are you sure to delete?', function (confirm) {
                                                                                                                                                        jQuery. 🎜>            }); 🎜>    }



4. Under the function, add the pop-up box style code




Copy the code

The code is as follows:

      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:
[
, type: "hidden" }, // Hide field, save value for pop-up selection number
                                                                                                                                    , type: "text", validate: { required: true, digits: true} },
    , Width: 150, Space: 30, Type: "Select", Option: {}}, // pop the selection box
{display: "unit", 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:" production date ", name:" madedate1 ", newLine: true, labelwidth: 100, space: 30, type:" date ", ATE ; : true, digits: true} }
                                                                           
LG. validate(mainform, { debug: true });
                                                                                                                                                                                                          ligerui.get("ProId2").set('onBeforeOpen', f_selectCoct)
                                                                                                                          ligerui.get(("ProId2"). ").set('onBeforeOpen', f_selectFary_2)
$.ligerui.get("Froce2").set('onBeforeOpen', f_selectFroace)
detailWin = $.ligerDialog.open({
target: $ ("#Editdetail"),
Width: 595, Height: 460, TOP: 80, Title: "Add Save Modification Window", // 240
Buttons: [
{text: Save ' , onclick: function () { save(); } },
                                                                                         >


6. Save events


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn