javascript - 在 sencha 的主视图中包含多个 View

标签 javascript iphone model-view-controller mobile extjs

我需要制作一个应用程序,其中有单独的模块,如用户、类别。我想为所有这些创建单独的 View ,然后最后想在主视图中调用。我是 Sencha 的新手。如何做到这一点?

Ext.application({
    name: 'AM',

    appFolder: 'app',

    launch: function() {
        Ext.create('Ext.container.Viewport', {
            layout: 'fit',
            items: [
                {
                   //need to replace this with app.views.userPage,how??????????
                    xtype: 'panel',
                    title: 'Users',
                    html : 'List of users will go here'
                },
                {
                    xtype: 'panel',
                    title: 'category',
                    html : 'List of category will go here'
                }

            ]
        });
    }
});

最佳答案

在 github 上,Francis Shanahan 以 MVC 风格构建了一个简单的 sencha touch 2 应用程序,如果您可以了解他如何定义 View ,然后使用别名配置来定义自定义 xtypes,那么它应该可以回答您的问题。 https://github.com/FrancisShanahan/SenchaTouch2MVCHelloworld

关于javascript - 在 sencha 的主视图中包含多个 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10695665/

相关文章:

javascript - 灯箱/表格问题

iphone - 苹果陀螺仪示例代码

iphone - 如何使用 iPhone SDK 访问身份配置文件和证书?

php - 面向对象的 PHP 和 MVC : calling a method from another controller?

java - 当输入事件仅影响View时,有关Controller及其角色(如果有)的MVC设计帮助

c# - 如何从 dll 中反编译/提取 (cshtml--(razor view))

javascript - 如何在 vis.js 时间轴中获取开始和结束时间?

javascript - 防止 Angular $httpProvider 拦截器在模板加载时触发

javascript - 使用 NodeGit/LibGit2 将文件写入不在根目录的裸存储库

iphone - 设置应用程序的最低 iPhone 操作系统版本?