PDA

View Full Version : sencha cmd v3. compile mvc structure ?



maneljn
6 Nov 2012, 2:34 AM
When i use sencha compile command is it compatible with MVC structure ?
The is that i put the app folder in classpath , but no one controller, model, etc... is included in all-classes.js



sencha compile -classpath=.\app,..\..\libs\extjs_v4_1_1_a\src,..\..\libs\extjs_cesi -ignore Ext.ux.form.TinyMCETextArea.js -ignore portalpanel.js -ignore Ext.ux.calendar.CalendarPanel.js page -yui -in ./index_desarrollo.php -out ./index.php

maneljn
6 Nov 2012, 9:39 AM
i think that compiler only adds mvc structure if you define it like this



Ext.application({
name: 'esitareas',
autoCreateViewport: false,
enableQuickTips: true,
appFolder: '.',

controllers: [
// Controladores eSItareas
'main', 'mainStatusBar',
'listas.mant',
'tareas.mant', 'tareas.imprimir'
],
.....


if you define like this, the mvc javascript classes are not included



esitareasApp = Ext.create('Ext.app.Application', {
name: 'esitareas',
autoCreateViewport: false,
enableQuickTips: true,
appFolder: '.',

controllers: [
// Controladores eSItareas
'main', 'mainStatusBar',
'listas.mant',
'tareas.mant', 'tareas.imprimir'
],
.....


Is this normal ?

dongryphon
6 Nov 2012, 10:00 PM
You are correct - the proper way to start your MVC app is Ext.application and this is specially recognized by Cmd.

What framework and version are you using?

maneljn
7 Nov 2012, 12:08 AM
I'm using Extjs v 4.1.1.a

team.avesta
20 Nov 2012, 4:02 AM
Did anybody get any solution to this problem..?? Please Share it on forum...
.
Thanks

ldonofrio
20 Nov 2012, 4:47 AM
I've the same problem, i've to require MyApp.controller.* to get my app files included.
I'm on 4.1.1a
Any help?

Regards
Leonardo

maneljn
20 Nov 2012, 7:43 AM
i have had to use this creation method, and then all controllers, etc... was included in compilation



Ext.application({
name: 'esitareas',
autoCreateViewport: false,
enableQuickTips: true,
appFolder: '.',

controllers: [
// Controladores eSItareas
'main', 'mainStatusBar',
'listas.mant',
'tareas.mant', 'tareas.imprimir'
],
.....


This other method does'nt work.



esitareasApp = Ext.create('Ext.app.Application', {
....

dongryphon
20 Nov 2012, 12:13 PM
Cmd processed the dependencies of an MVC application either by deriving from Ext.app.Application (or Controller) or by calling Ext.application.

In dev mode, this is now handled the same way in 4.1.3+ to avoid synchronous loading the dependencies and generating warnings on the console.

ldonofrio
20 Nov 2012, 12:17 PM
And what about 4.1.1a?


Cmd processed the dependencies of an MVC application either by deriving from Ext.app.Application (or Controller) or by calling Ext.application.

In dev mode, this is now handled the same way in 4.1.3+ to avoid synchronous loading the dependencies and generating warnings on the console.

dongryphon
20 Nov 2012, 12:21 PM
The call to Ext.application is understood by Cmd and Ext JS 4.1.1a but other forms of creating Ext.app.Application instances are not understood by Cmd. In 4.1.1a, the Ext.application call uses the Ext.app.Application constructor to synchronously load dependencies that have not been otherwise loaded, but you can ignore those warnings for now as they will go away in 4.2.

dongryphon
20 Nov 2012, 12:24 PM
By "not understood" I mean that Cmd won't pick up the "models", "views" and "controllers" dependencies when instantiating Ext.app.Application...

JorisA
10 Apr 2013, 10:04 AM
I think I'm still experiencing the same issue, even though I defined the app the normal way (by sencha architect)


//@require @packageOverrides
Ext.Loader.setConfig({
enabled: true,
paths: {
'Ext.ux': './ux',
'ECLG.generator': './data/generator'
}
});

Ext.application({

requires: [
'ECL.controller.*',
'ECL.view.*'
],
models: [
'Model1',
'Model2'
],
stores: [
'Store1'
],
views: [
'MainViewport'
],
autoCreateViewport: true,
controllers: [
'Navigation'
],
name: 'ECL',

launch: function() {
[...]
}
});

When I remove the requires parameter controllers and views are not loaded, is this expected?

FoxMulder900
30 Apr 2013, 7:12 AM
I am experiencing this same issue, it seems to work fine if your app has been generated by sencha cmd and you are using "sencha app build". So the functionality is there to automatically include the correct files without using "requires". The question is why does it not work with "sencha compile"? Is there an additional flag that needs to be passed, or is it actually a bug?

I have found a few other posts about the issue as well, the first one here indicates that it was marked as a bug back in December, any updates on that?

http://www.sencha.com/forum/showthread.php?250205
(http://www.sencha.com/forum/showthread.php?250205)http://stackoverflow.com/questions/15317222/sencha-cmd-extjs-build-does-not-include-mvc-controllers