gpt4 book ai didi

javascript - 如何在 MS CRM 2013 中创建内联对话框

转载 作者:搜寻专家 更新时间:2023-11-01 05:00:53 25 4
gpt4 key购买 nike

MS CRM 2013 引入了在系统内打开对话框的新方法。在 2011 版中,查找作为单独的(模态)窗口打开,但在 2013 版中,查找在当前页面上作为内联 iframe 打开。

绝对可以通过以下 jQuery 语句实现:

$('body').append("<div id='InlineDialog_Background' class='ms-crm-InlineDialogBackground' tabindex='0' style='position: absolute; width: 100%; height: 100%; top: 0px; background-color: rgb(128, 128, 128); z-index: 1005; opacity: 0.5;'></div>");
$('body').append("<div id='InlineDialog' class='ms-crm-DialogChrome' tabindex='1' style='position: absolute; top: 50%; left: 50%; z-index: 1006; margin-top: -240px; margin-left: -400px; height: 540px; width: 800px;'><iframe id='InlineDialog_Iframe' name='InlineDialog_Iframe' src='custom_url' style='height: 540px; width: 800px; border: 0px;'></iframe><div id='DialogLoadingDiv' style='position: absolute; background-color: white; height: 480px; width: 800px; top: 50%; left: 50%; margin-top: -240px; margin-left: -400px; z-index: 1007; display: none;'><table class='ms-crm-LoadingContainer' style='width:100%;height:100%'><tbody><tr class='ms-crm-LoadingContainer'><td style='vertical-align: middle' align='center'><img id='DialogLoadingDivImg' alt='' src='/_imgs/AdvFind/progress.gif'><br>Loading...</td></tr></tbody></table></div></div>");

但它还需要一些额外的例程才能正确关闭此类对话框。

有没有微软提供的javascript方法可以打开这样的iframe

最佳答案

Here就是在这样的对话框中显示网页资源的例子。

在父窗口中:

var src = <Relative_Url_of_the_Webresource>;
var DialogOptions = new Xrm.DialogOptions();
DialogOptions.width = 500;
DialogOptions.height = 400;
Xrm.Internal.openDialog(src, DialogOptions, null, null, CallbackFunction);

function CallbackFunction(returnValue){ }

此外,您还必须在您的网络资源中包含 ClientGlobalContext.js.aspx,例如:

<script type="text/javascript" src="/webresources/ClientGlobalContext.js.aspx"></script> 

用于将对话框的返回值传递给父窗口:

Mscrm.Utilities.setReturnValue(result);
try {
closeWindow(true); //Close the dialog box
}
catch (e) { }

关于javascript - 如何在 MS CRM 2013 中创建内联对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23653632/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com