artDialog外掛應用

Mr-Wanter發表於2016-05-09

1. 引入指令碼<script src="~/Scripts/artDialog.source.js?skin=blue"></script>,這裡預設樣式皮膚為藍色,也可以不寫後面的引數


2.     

function addDialog(id, title) {
        art.dialog({
            title: title,
            lock: true,                                  //鎖屏 中斷使用者在對話方塊以外的互動,展示重要操作與訊息
            fixed: true,
            content: document.getElementById("div_add"), //要展示的彈出框內容
            skin: 'blue',
            zIndex: 6000,
            init: function () {
                if (id == 0) {
                    // clear();
                    $('#box')[0].reset();               //如果id=0,清除form表單曾經讀取的資料(easyui)使表單為空

                }
            },
            okVal: "提交",
            ok: function () {
                setData(id);                            //新增或修改資料方法
            },
            cancelVal: "關閉",
            cancel: function () {


            }
        });
    }

通常我們應用此外掛對資料的新增修改部分功能,所以上面的方法傳遞了2個引數,一個是記錄的id,另一個為彈出框的title。


3 效果圖展示


相關文章