Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 778 Bytes

dialog.rst

File metadata and controls

47 lines (38 loc) · 778 Bytes

弹出窗口(Dialog) API

.. index:: dialog

创建弹出窗口。

  • 参数:
    • object options: 配置信息
  • 返回: KDialog
  • 继承: KWidget ( :ref:`K.widget` )

示例:

var dialog = K.dialog({
        width : 500,
        title : '测试窗口',
        body : '<div style="margin:10px;"><strong>内容</strong></div>',
        closeBtn : {
                name : '关闭',
                click : function(e) {
                        dialog.remove();
                }
        },
        yesBtn : {
                name : '确定',
                click : function(e) {
                        alert(this.value);
                }
        },
        noBtn : {
                name : '取消',
                click : function(e) {
                        dialog.remove();
                }
        }
});