您的位置:首页 > 产品设计 > UI/UE

基于EasyUI的软件框架打造-界面操作

2012-06-27 09:28 281 查看
通过制订好界面层的UI操作方式,开发人员只管调用即可,这样可以统一界面显示风格:

//----------------------------------------------------------------------------------
//窗口控制
_this.clearDialog = function () { //清理所有窗口
for (var i = 0; i < dialogs.length; i++)
dialogs[i].window('close');
dialogs.splice(0, dialogs.length);
}
_this.dialog = function (id, s) { //在页面内显示一个子窗口
var _dialog = $("#" + id).window({
shadow: true,
modal: false,
minimizable: false,
maximizable: false,
collapsible: true
});
dialogs.push(_dialog);
}
_this.dialog2 = function (id1, id2) { //显示两个左右窗口,用于比较
var _width = _this.pageWidth();
var _dialog1 = $("#" + id1).window({
left:50,
width:(_width-100)/2,
shadow: true,
modal: false,
minimizable: false,
maximizable: false,
collapsible: true
});
var _dialog2 = $("#" + id2).window({
left: (_width - 100) / 2 + 50,
width: (_width - 100) / 2,
shadow: true,
modal: false,
minimizable: false,
maximizable: false,
collapsible: true
});
dialogs.push(_dialog1, _dialog2);
}
_this.msnMsg = function (title, msg, timeout) {
if (!timeout) timeout = 0;
$.messager.show({ title: title, msg: msg, timeout: timeout });
}
_this.message = function (title, msg, icon) {
if (!icon) icon = 'info';
$.messager.alert(title, msg, icon);
}
_this.errorMsg = function (msg) {
$.messager.alert('错误', msg, 'error');
}
_this.yesnoMsg = function (msg, fun) {
$.messager.confirm('选择', msg, fun);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐