本文主要是介绍Easyui封装公用创建dialog的JS函数,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、宽度和高度给定
function createDialog(dialogFrame, dialogId, dialogTitle, dialogUrl)
{var div = $('#'+dialogFrame);var html = '<div id="'+dialogId+'"></div>';div.empty();div.append(html);$.parser.parse(div);var url = dialogUrl;//var url = 'allpage/page/assistSystem/cashManager/cashSettlementManager/cashSettlementManagerLC/tvmCashSettlementDialog.jsp';$("#"+dialogId).dialog({title : dialogTitle,width : '70%',height : '70%',closed : false,cache : false,draggable : false,href : url,modal : true,onClose : function(){$(this).dialog('destroy');}});
}
2、宽度可自由设定
function createDialogWithSize(dialogFrame, dialogId,dialogTitle, dialogUrl,width,height)
{var div = $('#'+dialogFrame);var html = '<div id="'+dialogId+'"></div>';div.empty();div.append(html);$.parser.parse(div);var url = dialogUrl;//var url = 'allpage/page/assistSystem/cashManager/cashSettlementManager/cashSettlementManagerLC/tvmCashSettlementDialog.jsp';$("#"+dialogId).dialog({title : dialogTitle,width : width,height : height,closed : false,cache : false,draggable : false,href : url,modal : true,onClose : function(){$(this).dialog('destroy');}});
}
这篇关于Easyui封装公用创建dialog的JS函数的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!