Secha ExtJs工作区和多个页面(应用程序)

时间:2023-01-27 10:40:14

I understand how to create and use multiple pages(or apps) within a workspace and build them. I am kind of confused about how do you make these multiple apps talk to each other ?

我了解如何在工作区中创建和使用多个页面(或应用程序)并构建它们。我对你如何让这些多个应用程序互相交流感到困惑?

lets say I have two apps in my workspace - App1 and App2.

假设我的工作区中有两个应用程序 - App1和App2。

I can use routing and make apps talk to each other if the value is simple enough(like a user id).

如果值足够简单(如用户ID),我可以使用路由并使应用程序相互通信。

What If i have to send multiple id's or data from App1 to App2 ?

如果我必须从App1向App2发送多个ID或数据?

2 个解决方案

#1


I think you have a few options available.

我想你有几个选择。

  • URL Parameters that you parse when instantiating the second application: http://example.com/app2.html?one=1

    实例化第二个应用程序时解析的URL参数:http://example.com/app2.html?one = 1

  • Anchor in the location: http://example.com/app2.html#one:1

    锚定位置:http://example.com/app2.html#one:1

  • If the applications are hosted on the same domain, you can use something like SessionStorage or LocalStorage (provided they are available to the client)

    如果应用程序托管在同一个域中,您可以使用SessionStorage或LocalStorage(如果它们可供客户端使用)

  • Set a cookie

    设置一个cookie

#2


You can add and remove cards panels dynamically in one page without providing 2 or more pages.The sencha app is designed for single page app.

您可以在一个页面中动态添加和删除卡面板,而无需提供2个或更多页面.sencha应用程序专为单页面应用程序设计。

#1


I think you have a few options available.

我想你有几个选择。

  • URL Parameters that you parse when instantiating the second application: http://example.com/app2.html?one=1

    实例化第二个应用程序时解析的URL参数:http://example.com/app2.html?one = 1

  • Anchor in the location: http://example.com/app2.html#one:1

    锚定位置:http://example.com/app2.html#one:1

  • If the applications are hosted on the same domain, you can use something like SessionStorage or LocalStorage (provided they are available to the client)

    如果应用程序托管在同一个域中,您可以使用SessionStorage或LocalStorage(如果它们可供客户端使用)

  • Set a cookie

    设置一个cookie

#2


You can add and remove cards panels dynamically in one page without providing 2 or more pages.The sencha app is designed for single page app.

您可以在一个页面中动态添加和删除卡面板,而无需提供2个或更多页面.sencha应用程序专为单页面应用程序设计。