Threaded View

  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    14
    Vote Rating
    0
    Answers
    1
    fmuke is on a distinguished road

      0  

    Default Answered: ext js 4 MVC tutorial do not work ...

    Answered: ext js 4 MVC tutorial do not work ...


    ok ... for some reason the code that i get from the EXT JS 4 MVC architecture do not work.

    i can't load the controller ... i don't understand why ... please help.

    need to use controller for it won't work at all !!!
    app.js
    --------
    Ext.application({
    name: 'AM',
    appFolder: 'app',
    controllers: ['AM.controller.Users'], // ---> if i remove this, it will work but i wont have a controller
    launch: function () {
    var me = this;
    Ext.create('Ext.container.Viewport', {
    layout: 'fit',
    items: [
    {
    xtype: 'panel',
    title: 'Users',
    html: 'List of users will go here'
    }
    ]
    });
    console.log('hello from app.js');

    }
    });

    controller
    ------------
    Ext.define('AM.controller.Users', {
    extend: 'Ext.app.Controller',

    init: function () {
    console.log('hello1 from controller Users.js');
    this.control({
    'viewport > panel': {
    render: this.onPanelRendered
    }
    });
    },

    onPanelRendered: function () {
    console.log('hello2 from controller Users.js');
    }
    });

  2. thank you guys for your help ....
    i found the annoying problem ...
    Ext.Loader.setConfig({enabled: true});

    Ext.require('Ext.container.Viewport');

    Ext.application({
    name: 'App',

    appFolder: '/NUKEAPPS/app', //<---here is the mistake . i needed to specify the app right location

    controllers: ['Books'],

    launch: function() {

    console.log('called function launch - application');

    Ext.create('Ext.container.Viewport', {
    layout: 'fit',
    items: [
    {
    xtype: 'panel',
    title: 'Books',
    html : 'List of books will be displayed here'
    }
    ]
    });
    }
    });