• 在次封装easyuiDialog 插件


    $.fn.hDialog = function (options) {
            
    var defaults = {
                 
    300,
                height: 
    200,
                title: 
    '此处标题',
                html: 
    '',
                iconCls: 
    '',
                submit: 
    function () { alert('可执行代码.'); }
            }
            
    var id = $(this).attr('id');
            options 
    = $.extend(defaults, options);
            
    var self = this;

            $(self).dialog({
                title: options.title,
                height: options.height,
                 options.width,
                iconCls: options.iconCls,
                buttons: [{
                    text: 
    '确定',
                    iconCls: 
    'icon-ok',
                    handler: options.submit
                }, {
                    text: 
    '取消',
                    iconCls: 
    'icon-cancel',
                    handler: 
    function () {
                        $(
    '#' + id).dialog('close');
                    }
                }]
            });

            
    function createContent() {
                $(
    '.dialog-content',$(self)).empty().append('<div id="' + id + '_content" style="padding:5px;"></div>');
                $(
    '#' + id + "_content").html(options.html);
            }
            createContent();
        }

    调用:

    $(function(){
      var d =$('<div id="d"></div>');
      $(
    '#d').hDialog({submit:function(){$(d).dialog('close');}});
    })
  • 相关阅读:
    多列转两列(Power Query)
    多簿多表合并(Power Query)
    高亮显示指定内容
    价格段公式
    按日期段计算平均销量
    Filter、Unique如何跳过隐藏行
    人民币填空
    按换行符拆分(Power Query)
    添加分类汇总小计行(Power Query)
    添加累计列(Power Query)
  • 原文地址:https://www.cnblogs.com/hxling/p/1875542.html
Copyright © 2020-2023  润新知