EasyUI的一些封装方法

时间:13-04-23 栏目:EasyUI, web前端 作者:zongyan86 评论:0 点击: 7,798 次

//弹出提醒框alert
function showMsg(title, msg, isAlert) {
if (isAlert !== undefined && isAlert) {
$.messager.alert(title, msg);
} else {
$.messager.show({
title: title,
msg: msg,
showType: 'show'
});
}
}

//删除确认confirm
function deleteConfirm() {
return showConfirm('温馨提示', '确定要删除吗?');
}

//弹出确认框confirm
function showConfirm(title, msg, callback) {
$.messager.confirm(title, msg, function (r) {
if (r) {
if (jQuery.isFunction(callback))
callback.call();
}
});
}

//进度条
function showProcess(isShow, title, msg) {
if (!isShow) {
$.messager.progress('close');
return;
}
var win = $.messager.progress({
title: title,
msg: msg
});
}

//弹出框体window
function showMyWindow(title, href, width, height, modal, minimizable, maximizable) {

$('#myWindow').window({

title: title,

width: width === undefined ? 600 : width,

height: height === undefined ? 400 : height,

content: '<iframe scrolling="yes" frameborder="0"  src="' + href + '" style="width:100%;height:98%;"></iframe>',

//        href: href === undefined ? null : href,

modal: modal === undefined ? true : modal,

minimizable: minimizable === undefined ? false : minimizable,

maximizable: maximizable === undefined ? false : maximizable,

shadow: false,

cache: false,

closed: false,

collapsible: false,

resizable: false,

loadingMessage: '正在加载数据,请稍等片刻......'

});

}

//关闭弹出框体 window
function closeMyWindow() {

$('#myWindow').window('close');

}

web技术分享



声明: 本文由( zongyan86 )原创编译,转载请保留链接: EasyUI的一些封装方法

关注我们