1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    249
    Vote Rating
    1
    Answers
    2
    Ex_Soft is an unknown quantity at this point

      0  

    Default Answered: MVC && File Structure

    Answered: MVC && File Structure


    app.js
    Code:
    Ext.Loader.setConfig({
        enabled: true,
        disableCaching: false
    });
    
    Ext.application({
        name: "M3",
    
        appFolder: "app",
    
        autoCreateViewport: true
    });
    app/view/Viewport.js
    Code:
    Ext.define("M3.view.Viewport" , {
        extend: "Ext.container.Viewport",
        requires: ["maintbar"],
        layout: "fit",
        items: [
            {
                tbar: { xtype: "maintbar" } // Ext.create("M3.view.MainTbar")
            }
        ]
    });
    app/view/MainTbar.js
    Code:
    Ext.define("M3.view.MainTbar" ,{
        extend: "Ext.toolbar.Toolbar",
        alias : "widget.maintbar",
        items: [
            {
                xtype: "button",
                text: "DoIt!"
            }
        ]
    });
    Quote Originally Posted by console
    "NetworkError: 404 Not Found - http://localhost/maintbar.js"
    app/view/Viewport.js is successfully loaded when I use Ext.create("M3.view.MainTbar") instead of xtype. Why http://localhost/maintbar.js instead of http://localhost/app/view/maintbar.js?

  2. I think the 'requires' class name should be fully qualified:

    Code:
    Ext.define("M3.view.Viewport" , {
        extend: "Ext.container.Viewport",
        requires: ['M3.view.MainTbar'],
        layout: "fit",
        items: [
            {
                tbar: { xtype: "maintbar" } // Ext.create("M3.view.MainTbar")
            }
        ]
    });

  3. #2
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Vote Rating
    27
    Answers
    106
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    I think the 'requires' class name should be fully qualified:

    Code:
    Ext.define("M3.view.Viewport" , {
        extend: "Ext.container.Viewport",
        requires: ['M3.view.MainTbar'],
        layout: "fit",
        items: [
            {
                tbar: { xtype: "maintbar" } // Ext.create("M3.view.MainTbar")
            }
        ]
    });

Thread Participants: 1