zoukankan      html  css  js  c++  java
  • 自定义dialog

    有时候开发需要用到dialog,但是往往会不如实际需求,这里给大家列一个自定义的dialog,具体配置可以察看http://www.lhgdialog.com/api/的介绍

    $.dialog({

    //dialog的id,后面可以用户关闭该dialog操作,代码$('#ownAddModal').dialog('close');
    id: 'ownAddModal',

    //头部标题
    title: '添加',

    //宽度设置
    iWidth,

    //高度设置
    height:iHeight,

    //能否拖拽
    drag: false,

    //能否扩大缩小
    resize: false,

    //这里可以是具体的内容,字符串,也可以是一个后台给的页面接口,当是一个页面的时候需要使用url:前缀
    content: 'url:msgNoticeController.do?goAdd',

    //自定义按钮
    button : [{
    name : '保存',

    //是否获得聚焦点
    focus : true,

    //点击按钮触发事件
    callback : function() {

    //这里可以通过this.iframe.contentWindow;来获取当前页面下的元素,用于dom操作,比如获取页面中的一个id为userid的input元素的内容,写为$('#userid',iframe.document).val()
    iframe = this.iframe.contentWindow;

    //自定义方法
    commonSend(iframe,'添加成功','msgNoticeController.do?doAdd','');
    }
    },
    {
    name : '保存为模板',
    focus : true,
    callback : function() {
    iframe = this.iframe.contentWindow;
    commonSend(iframe,'添加成功','msgNoticeController.do?doAdd','');
    }
    },
    {
    name : '取消',
    focus : true,
    callback : function() {

    //关闭dialog
    $('#ownAddModal').dialog('close')
    }
    }]

  • 相关阅读:
    CF995A Tesla
    CF961D Pair Of Lines
    P1186 玛丽卡
    CF986B Petr and Permutations
    hdu6331 Problem M. Walking Plan
    Edison UVALive3488
    Be a Smart Raftsman SGU475
    100198H Royal Federation
    100197G Robbers
    Evil Book -- CodeChef
  • 原文地址:https://www.cnblogs.com/shenwh/p/10433267.html
Copyright © 2011-2022 走看看