0
votes

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.

2

2 Answers

0
votes

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.

0
votes

If you are going for a real application then the best approach is to generate a sample application with Cmd, as you already did, and then to modify it for your needs.

That would involve moving your logic from one file to appropriate files in the MVC folder structure piece by piece often testing if it is working.

If you only want to continue with one file (not recommended) then read this: Single File ExtJS 5 Application w/o Sencha Cmd