基于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);
}
//----------------------------------------------------------------------------------
//窗口控制
_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);
}
相关文章推荐
- 基于EasyUI的软件框架打造-数据(JSON)封装
- 基于EasyUI的软件框架打造-树(Tree)封装
- 基于EasyUI的软件框架打造-多层
- 基于EasyUI的软件框架打造-数据交互
- 基于MVC4+EasyUI的Web开发框架经验总结(2)- 使用EasyUI的树控件构建Web界面
- 基于MVC+EasyUI的Web开发框架经验总结(9)--在Datagrid里面实现外键字段的转义操作
- 基于MVC+EasyUI的Web开发框架经验总结(2)- 使用EasyUI的树控件构建Web界面
- 基于MVC+EasyUI的Web开发框架经验总结(10)--在Web界面上实现数据的导入和导出
- 基于asp.net + easyui框架——界面(一)
- 基于Oracle数据库,用SSM框架和easyUI实现分页查询操作
- MFC框架界面开发(五):基于文档模板架构的软件
- (转)基于MVC4+EasyUI的Web开发框架经验总结(2)- 使用EasyUI的树控件构建Web界面
- 基于MVC4+EasyUI的Web开发框架经验总结(2)- 使用EasyUI的树控件构建Web界面
- 基于MVC+EasyUI的Web开发框架经验总结(14)--自动生成图标样式文件和图标的选择操作
- 基于Chrome开源提取的界面开发框架 二
- Java -- 数据库 多表操作,1对多,多对多,1对1。 基于dbutils框架
- jquery-easyui实现页面布局和增删改查操作(SSH2框架支持)
- 基于Chrome开源提取的界面开发框架 三(.1.5)
- 基于PyQt5的数据库可视化操作界面
- 基于一个中心、四个基本点打造软件平台的经验教训分享(1/2)