Easyui 使用笔记

  • window 使用
  • dialog 使用

window使用

  1. ajax打开子页面
<div id="openWindow"></div>
$('#openWindow').window({
    width: 780,
    modal: true,
    height: 590,
    href: url
   });

2.打开普通对话框

<div id="windowID" class="easyui-window" inline="false" closed="true" title="温馨提示" data-options="iconCls:'icon-save',modal:true"  style="width:700px;height:auto;">
对话框内容
</div>
$("#windowID").window('open');

dialog 使用

  1. 普通用
$("#id").dialog('open');
$("#id").dialog('close');
  1. open url
$('#dd').dialog({
    title: 'My Dialog',
    width: 400,
    height: 200,
    closed: false,
    cache: false,
    href: 'get_content.php',
    modal: true
});
  1. 带工具条
$("#withdrawnList_div").dialog({
    title : 'title',
    height : 400,
    width: 620,
    modal : true,
    toolbar: [ {
      text : '确定',
      iconCls : 'icon-add',
      handler : function() {
        //do something
      }
    }, {
      text : '取消',
      iconCls : 'icon-reload',
      handler : function() {
        $(this).dialog('close');
      }
    } ]
  });
  1. 带按钮
$("#withdrawnList_div").dialog({
    title : 'title',
    height : 400,
    width: 620,
    modal : true,
    buttons : [ {
      text : '确定',
      iconCls : 'icon-add',
      handler : function() {
        //do something
      }
    }, {
      text : '取消',
      iconCls : 'icon-reload',
      handler : function() {
        $(this).dialog('close');
      }
    } ]
  });

你可能感兴趣的:(easyui)