启用window.showModalDialog复制粘贴选项 [英] enable copy paste option in window.showModalDialog

查看:1521
本文介绍了启用window.showModalDialog复制粘贴选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序的一些.aspx页面中都被称为window.showModalDialog像下面

In my application some of the .aspx page are called by window.showModalDialog like below

window.showModalDialog('../SelectUser.aspx?',window,sFeatures);

在这里sFeatures声明像下面

where sFeatures is declared like below

sFeatures = "dialogWidth=400px;dialogHeight=450px;border=thick;center=yes;help=no;status=no;title=Task";

在页面的位置通过ShowModalDialog的clled所有网页,复制粘贴选项默认为禁用。我怎样才能实现从在showModalDialog页面复制粘贴选项。

In all the page where the page is clled through ShowModalDialog, the copy paste option is by default disabled. How can i enable the copy paste option from showModalDialog page.

推荐答案

这在showModalDialog文档报价上的 MSDN

Quote from showModalDialog documentation on MSDN

无论是模式还是无模式HTML对话框支持文本选择或复制操作的标准快捷菜单;但是,您可以通过使用脚本的TextRange对象和事件处理程序onmousedown事件和的OnMouseMove,如下面的例子模仿此功能。

Neither modal nor modeless HTML dialog boxes support text selection or the standard shortcut menu for copy operations; however, you can imitate this functionality by using script with TextRange objects and event handlers for onmousedown and onmousemove, as in the following example.

code例如:<一href=\"http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialogLaunch.htm\" rel=\"nofollow\">http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialogLaunch.htm

作为一种替代方法,你可以实现自己的模态对话框

As an alternative you can implement your own modal dialog

var dlg = window.open(url, '_blank', 'modal=yes,dialog=yes');

var winFocus = window.onfocus;

window.onfocus = function() {
    if (dlg /* && possible additional condition based on dialog flow */) {
        dlg.focus();
    } else {
        window.onfocus = winFocus;
        // callback for dialog closing
    }
}

这篇关于启用window.showModalDialog复制粘贴选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆