Hello to all,

I am a newbie for ExtJS and following the "Learning Ext JS -4th Edition" book which is published by Packtpub. @https://www.packtpub.com/web-development/learning-extjs-fourth-edition

I am on the chapter 10: Architecture and developing an application with Sencha CMD based on MVC design. Structure of app like this:

Code:
./myApp
  app/
    app.js
    index.html

    controller/
      app.js

    model/
      Customers.js
      modulesModel.js

    store/
      Customers.js
      modulesTreeDs.js

    view/
      modules/
        customerController.js
        customers.js
      appZone.js
      myViewport.js

  serverside/
    data/
      customer.json
      menu_extended.json
Briefly i created the main interface on view/myViewport, then view/appZone.js which stays for modules's tree panel on left side and a 'main zone' in the middle for displaying modules screen on tabpanel. Here is an example of view;

Screenshot from 2017-06-30 17-16-53.png

The error is come up during clicking "Customer" module and says;
Code:
Uncaught TypeError: Cannot read property 'items' of undefined    at constructor.addModule (app.js?_dc=1498826943894:49)
    at constructor.handleAccess (app.js?_dc=1498826943894:38)
    at constructor.fire (ext-all-rtl-debug.js?_dc=1498826943895:11885)
    at constructor.dispatch (ext-all-rtl-debug.js?_dc=1498826943895:33727)
    at constructor.callParent (ext-all-rtl-debug.js?_dc=1498826943895:7408)
    at constructor.dispatch (ext-all-rtl-debug.js?_dc=1498826943895:33909)
    at constructor.prototype.doFireEvent (ext-all-rtl-debug.js?_dc=1498826943895:33835)
    at constructor.fireEventArgs (ext-all-rtl-debug.js?_dc=1498826943895:12392)
    at constructor.<anonymous> (ext-all-rtl-debug.js?_dc=1498826943895:12654)
    at constructor.fire (ext-all-rtl-debug.js?_dc=1498826943895:11885)
As mention on error, i checked for app.js that mentioned above. The error come up in controller class of module view, during ExtJs adding a new module as a new tab in 'main zone'. Here is the code block of app.js

Code:
Ext.define('myApp.controller.app', {
  extend: 'Ext.app.Controller',
  requires: [
    'myApp.view.appZone',
    'myApp.view.myViewport'
  ],
  config: {
    refs: {
      myappzone: {
        selector: 'appzone',
        xtype: 'appzone',
        autoCreate: false
      }
    }
  },
  init: function () {
    console.log('App controller init');
    var me = this;
    this.control({
      'appzone #accessPanel treepanel' : {
        itemdblclick: me.handleAccess
      }
    });
  },
  handleAccess: function (cmpView, record, itemx, index, evt, eOpts) {
    console.log('Handle access for: ' + record.data.text);
    var me = this, moduleData = record.data;
    if (moduleData.hasOwnProperty('moduleType')) {
      var typeModule = moduleData.moduleType;
      if (typeModule == '') {
        return;
      } else if (typeModule == 'link') {
        me.executeLink(moduleData);
      } else if (typeModule == 'window') {
        me.runWindow(moduleData);
      } else if (typeModule == 'module') {
        me.addModule(moduleData);
      }
    }
  },
  addModule: function (data) {
    //console.log('Adding Module: ' + data.options);
    var me = this;
    var myZone = me.getMyappzone();
    var ModulesTab = myZone.query('tabpanel #mainZone')[0];
    var existModule = false;
    for (var i=0;i < ModulesTab.items.items.lenght;i++){
      if (ModulesTab.items.items[i].xtype==data.moduleAlias){
        existModule= true;
        break;
      }
    }
    if (existModule) {
      ModulesTab.setActiveTab(i);
      return;
    } else {
      var mynewModule = Ext.create(data.options);
      ModulesTab.add(mynewModule);
      ModulesTab.setActiveTab((ModulesTab.items.items.lenght -1));
      return;
    }
  },
  runWindow: function (data) {
    console.log('Execute window: ' + data.options);
    Ext.Msg.alert("Window module", "here we show window: <b>" + data.text + "</b>");
  },
  executeLink: function (data) {
    console.log('Launch link: ' + data.options);
    window.open(data.options);
  }
});
Error says there isn't any 'item' property and i checked function above the for loop line if any data is getting. Well, i created 'myZone' variable and passed all data from json file via model and store but it isn't fetch to "ModulesTab" so during debugging it says 'undefined' for "ModulesTab"...

I checked for potential reason such as JSON file, syntax error etc. but not any solution. Could any body can help me out about this error? If it's neccesarry i can publish whole code blocks of all class; view, modules, store, data etc.

Thank you very much..