004. EsayUI系列之easyui-window(2)

 有朋友提出了这样一个问题:

使用jquery easyui window控件创建一个窗体,并链接到一个新增页面,那么当新增成功后,怎么关闭窗体?能写一个这样的给我看吗?

 

简单能了个demo,不知道是否这个意思,可供参考:

页面body片段:

<div id="AddInfo" icon="icon-add" title="添加" style=" display:none;">
        <div style=" width:460px; height:100px; font-size:12px; color:Black;">
            <table style=" width:450px; height:100px; margin-left:20px; margin-top:15px;">
                <tr>
                    <td valign="middle" style=" width:100px">名称:</td>
                    <td valign="middle" style=" width:370px"><input id="Name" type="text" style=" width:350px"/></td>
                </tr>
                <tr>
                    <td valign="top">描述:</td>
                    <td valign="middle" style=" width:370px"><textarea id="Des" rows="4" cols="10" style=" width:350px;"></textarea></td>
                </tr>
            </table>
        </div>
    </div>

js片段:

function add() {
            $("#AddInfo").show();
            $("#AddInfo").attr("title", "添加例子");

            $("#AddInfo").dialog({
                width: 500,
                height: 200,
                draggable: true,
                resizable: false,
                modal: true,
                buttons:
                    [
                        {
                            text: '提交',
                            iconCls: 'icon-ok',
                            handler: function() {
                                //此处写提交按钮触发的事件
                            }
                        },
				        {
				            text: '取消',
				            handler: function() {
				                $('#AddInfo').dialog('close');
				            }
				        }
				    ]
            });
        }


 

运行后如下图所示:


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值