APL中提供的窗口组件不同于html中的原生window,它是通过div模拟出来的.本质上和父页面是在同一个dom树中.
window组件的内容是通过ajax动态加载进来的.所以加载页面中的所有对象在父页面中都可以直接获取到,反过来window也可以直接获取父页面的所有对象.
window组件的创建都是通过JavaScript脚本创建的.
function openWindow(){
var win = new Aurora.Window({id:'mywin', url:'user.screen',title:'窗口', height:400,width:700});
}
通过new Aurora.Window我们可以创建出一个window窗口.id是窗口的唯一标识,url指定当前窗口需要加载的screen文件.title指定打开窗口的标题,height和width分别指定窗口的大小.
Table 1.
参数名
|
用途
|
默认值
|
是否必填
|
---|
id
|
window窗口的id。
|
|
true
|
title
|
window窗口的标题。
|
|
false
|
url
|
window窗口的url。
|
|
true
|
height
|
window窗口的高度。
|
400
|
false
|
width
|
window窗口的宽度。
|
350
|
false
|
有时候我们仅仅需要显示一个提示信息,或者一个简单的警告.这个时候通过url加载就比较麻烦.
APL为我们提供了几个通用的窗口函数.
提示信息窗口
Aurora.showMessage(title, msg,callback,width,height);
Table 2.
参数名
|
用途
|
默认值
|
是否必填
|
---|
title
|
window窗口的标题。
|
|
true
|
msg
|
需要提示的信息内容
|
|
true
|
callback
|
回调函数,不需要的话用null
|
|
false
|
height
|
window窗口的高度。
|
100
|
false
|
width
|
window窗口的宽度。
|
300
|
false
|
带警告图标的窗口
Aurora.showWarningMessage(title, msg,callback,width,height);
配置参数参考"提示信息窗口"
带信息图标的窗口
Aurora.showInfoMessage(title, msg,callback,width,height);
配置参数参考"提示信息窗口"
带错误图标的窗口
Aurora.showErrorMessage(title, msg,callback,width,height);
配置参数参考"提示信息窗口"
带确定取消按钮的确认窗口
Aurora.showConfirm(title, msg, okfun,cancelfun, width, height);
Table 3.
参数名
|
用途
|
默认值
|
是否必填
|
---|
title
|
window窗口的标题。
|
|
true
|
msg
|
需要提示的信息内容
|
|
true
|
okfun
|
确定按钮回调函数,不需要的话用null
|
|
|
cancelfun
|
取消按钮回调函数,不需要的话用null
|
|
|
height
|
window窗口的高度。
|
100
|
false
|
width
|
window窗口的宽度。
|
300
|
false
|
Comments
3 Responses to the article