我面临的问题是,当我激活dijit.dialog()时,网页模糊,我无法连接页面,直到我关闭对话框。 有什么方法可以让对话框保持打开状态并仍然可以访问页面。 通过访问我的意思是网页应该能够听取点击事件或类似的事情。 如果没有,我可以使用其他工具吗?
Problem I am facing is that when I activate the dijit.dialog(), the webpage blurs and I can not connect with the page till I close the dialog box. Is there some way that I can keep the dialog box open and still access the page. By access I mean that the webpage should be able to listen to click events or things like that. If not is there some other tool that I can use?
最满意答案
考虑dojox/layout/FloatingPane因为dijit/Dialog非常硬连接为模态(通过单例):
// var FloatingPane = require("dojox/layout/FloatingPane"); var floatingPane = new FloatingPane({ title: "FloatingPane", content: "Hello World!", resizable: false, dockable: false }, "floatingPane"); floatingPane.startup();或者如果你坚持使用dijit/Dialog你可以继承它,但是期待可能的奇怪的东西,尤其是。 嵌套和/或组合模态/非模态对话框时:
// var Dialog = require("dijit/Dialog"); var ModelessDialog = declare(Dialog, { show: function() { this.inherited(arguments); Dialog._DialogLevelManager.hide(this); } });在jsFiddle中看到它的运作: http : //jsfiddle.net/phusick/TgEWL/
注意:在使用FloatingPane.时,不要忘记包含dojox / layout / resources / FloatingPane.css和dojox / layout / resources / ResizeHandle.css样式表FloatingPane.
Consider dojox/layout/FloatingPane because dijit/Dialog is quite hard-wired to be modal (via singletons):
// var FloatingPane = require("dojox/layout/FloatingPane"); var floatingPane = new FloatingPane({ title: "FloatingPane", content: "Hello World!", resizable: false, dockable: false }, "floatingPane"); floatingPane.startup();or if you insist on dijit/Dialog you can subclass it, but expect possible weird stuff, esp. when nesting and/or combining modal/non-modal dialogs:
// var Dialog = require("dijit/Dialog"); var ModelessDialog = declare(Dialog, { show: function() { this.inherited(arguments); Dialog._DialogLevelManager.hide(this); } });See it in action at jsFiddle: http://jsfiddle.net/phusick/TgEWL/
N.B.: Do not forget to include dojox/layout/resources/FloatingPane.css and dojox/layout/resources/ResizeHandle.css stylesheets when using FloatingPane.
更多推荐
发布评论