extjs mvc 导航

发布于 2025-01-03 12:22:28 字数 91 浏览 4 评论 0原文

我正在使用 extjs mvc 。我有 8 个视图要显示。每个视图都存在依赖关系。 我想知道如何向前和向后从一个视图导航到另一个视图。 建议我需要使用多个控制器或一个。

I am using extjs mvc . I have 8 views to display . there is a dependency on each view.
I wanted to know how to navigate from view to view in forward as well as backward direction.
suggest me i need to use multiple controllers or one.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如此安好 2025-01-10 12:22:28

我建议选择单一控制器方法。我们称之为导航控制器。
这种方法的主要优点是您可以分离导航逻辑并将其锁定在一个地方。将来更容易维护和查找所需的代码。

但这只是我的意见。

例子:

Ext.define('YourApp.controller.NavigationController', {
    extend: 'Ext.app.Controller',
    init: function () {
        this.control({
            'view1 button[text="View Search Results"]': {
                click: this.onViewSearchResults
            },
            'view2 button[text="View Search Details"]': {
                click: this.onViewSearchResultDetails
            }
            //....
        });
    });

I'd suggested to choose a single controller approach. Let's call it NavigationController.
The main advantage of this approach is that you separate your navigation logic and lock it in one place. It's easier to maintain and find needed coded in future.

However it's just my opinion.

Example:

Ext.define('YourApp.controller.NavigationController', {
    extend: 'Ext.app.Controller',
    init: function () {
        this.control({
            'view1 button[text="View Search Results"]': {
                click: this.onViewSearchResults
            },
            'view2 button[text="View Search Details"]': {
                click: this.onViewSearchResultDetails
            }
            //....
        });
    });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文