简体   繁体   English

在新窗口中打开主视图

[英]Opening a backbone view in a new window

i am developing a trigger.io application using backbone, the entire app is in one page but i need to open a detail page in a new window (not a modal view, a tab in android). 我正在使用骨干网开发trigger.io应用程序,整个应用程序都在一个页面中,但是我需要在新窗口(不是模式视图,android中的选项卡)中打开详细信息页面。

I don't know if it's possible to render a view in a new window, or write to history the view and navigate to the url. 我不知道是否有可能在新窗口中呈现视图,或写入历史记录视图并导航至URL。

Can anybody give me some tips. 谁能给我一些提示。

Thanks 谢谢

If you want to open a special view, specify a route calling this view. 如果要打开特殊视图,请指定一个调用该视图的路由。

Now you create a simple link with target blank to the route. 现在,您将创建一个简单的链接,目标为空白。

The application gets started in the new window and loads the action mapped to the route. 该应用程序将在新窗口中启动,并加载映射到该路线的动作。

I think this is the best solution to do this, although there are ways to create windows and communicate between them in JavaScript. 我认为这是实现此目的的最佳解决方案,尽管可以使用JavaScript创建窗口并在它们之间进行通信。 If you need to control the new tab, eg closing the tab or act on its content you are forced to create the new tab by javascript and keep a reference to the new tab. 如果您需要控制新选项卡,例如关闭选项卡或对其内容进行操作,则必须使用javascript强制创建新选项卡并保留对新选项卡的引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM