这里有两个问题,
1.Easyui中用于弹出对话框的opendialog()的参数列表是什么,大家要说全一点,因为我知道的就是四个参数的重载
2.如何设置openDialog()弹出的对话框没有右上角的叉号,或者可以提供一个当点击叉号时候能够触发的事件。
easyui没有什么openDialog,自己好好看api,打开窗口是open方法
不允许关闭配置closable为false,关闭事件onBeforeClose/onClose
主要看panel的事件和配置,dialog,window都是继承自panel
http://www.jeasyui.com/documentation/index.php#
jquery easyui dialog可以两种方式使用
1)定义div,使用iframe
需要显示dialog时使用以下2行即可
$('#openXXXIframe')[0].src='xxxEdit.action';
$('#openRoleDiv').dialog('open');
2)不使用iframe(请参见easyui的demo)
$(function(){
$('#dd').dialog({
toolbar:[{
text:'Add',
iconCls:'icon-add',
handler:function(){
alert('add')
}
},'-',{
text:'Save',
iconCls:'icon-save',
handler:function(){
alert('save')
}
}],
buttons:[{
text:'Ok',
iconCls:'icon-ok',
handler:function(){
alert('ok');
}
},{
text:'Cancel',
handler:function(){
$('#dd').dialog('close');
}
}]
});
});
打开用$('#dd').dialog('open');
dialog方法和属性的使用
a)setTitle修改dialog的标题$('#xxxDivId').dialog('setTitle', 'New Title');
查看easyui的代码发现setTitle的实际执行内容为
$('#xxxDivId').panel('options').title = 'New Title';
$('#xxxDivId').panel("header").find("div.panel-title").html('New Title');
b)options的使用
var tt = $('#xxxDivId').panel('options').closable; //这里是panel,不是dialog
alert(tt);//返回该对话框是否可以关闭
c)定位
$('#p').panel('move',{
left:100,
top:100
});