Search code examples
javascriptextjssencha-cmdextjs5

Sencha extjs 5 one file project NOT MVC


I'm new to Sencha extjs framework, I started on the files in the documentation, I made a lot of things so far but in one javascript file. I noticed then that I should make new project using Sencha cmd for smaller sized framework. I'm having troubles copying my code to the fresh new generated project. the project is generated in MVC style, and my code is all in one file, structured in casual manner.

Where should I put my code? Before using the new generated project the index.html had the references to the ext-all.js, theme.css, and the app.js files. but the generated project index.html has onle a reference on bootstrap.js. what this file for? and from where the application start rolling? I found a file called Application.js in [app] folder. And there is a file called app.js contains the Ext.Application method. I tried to put a lunch function there and put all my code above it, and start it in the lunch, but I faced too many errors!

Any help please.


Solution

  • Since ExtJS 5.0.x has upgraded, there are a few updates to the file/folder structure of an app built by sencha cmd. I would suggest you to look at the following link for more on how Sencha Cmd packages the app and information about the files:

    Using Sencha Cmd with ExtJS

    Supporting the MVVM architecture, each view sits in its own folder along with the associated ViewModel and ViewController. The app.json file has all the app config information. The app.js extends your Application.js file to make it easy for multiple apps to extend from your app. Application.js contains all the references within your application to all your app-wide controllers, models and views and the launch function to launch your app. Try adding your code here to see how it works as a single file app.