PDA

View Full Version : Build problem



rsqw
20 Dec 2011, 3:47 PM
Hi,

In my application I have this code:


Ext.require(['CJ.core.extra.Application', 'CJ.core.config.utils']);
Ext.onReady(function() {
Ext.create("CJ.core.extra.Application", {
name: 'CJ',
appFolder: '/js/app',
controllers: [
//widgets
....
//modules
'CJ.modules....,
'CJ.modules......',
'CJ.modules.......',
'CJ.modules..........',

I've performed this
sencha create jsb -a http://giggster.loc -p ./app.jsb
sencha build -p app.jsb -d .

Unfortunately, I can't see this code:
Ext.create("CJ.core.extra.Application", {
name: 'CJ',
appFolder: '/js/app',
controllers: [
//widgets
....
//modules
'CJ.modules....,
'CJ.modules......',
'CJ.modules.......',
'CJ.modules..........',
in my all-classes and app-all files,

What's the problem? Is this is my bug?

mitchellsimoens
20 Dec 2011, 3:54 PM
Are you using MVC?

rsqw
21 Dec 2011, 1:35 AM
Of course, but I've extended Ext.app.Application and rewritten it's constructor, because in my app, MVC isn't enought, I need HMVC.

mitchellsimoens
21 Dec 2011, 5:43 AM
Then you shouldn't be using Ext.onReady

rsqw
23 Dec 2011, 12:29 AM
I don't understand, could you explain?

mitchellsimoens
23 Dec 2011, 7:06 AM
If you are using MVC, then you should only use Ext.application not Ext.onReady

rsqw
26 Dec 2011, 6:37 AM
I can't use Ext.application, because I need to create NS.core.Application instead of Ext.app.Application :(

mitchellsimoens
26 Dec 2011, 6:41 AM
Ext.application is just an instance of Ext.app.Application so you should be able to create an instance of your NS.core.Application

rsqw
26 Dec 2011, 8:04 AM
Ext.application.toString()
"function (config) { Ext.require('Ext.app.Application'); Ext.onReady(function() { Ext.create('Ext.app.Application', config); });}"

rsqw
26 Dec 2011, 8:10 AM
I've solved this problem by myself:
Ext.application = function(a){Ext.require("NS.core.Application"); Ext.onReady(function(){
Ext.create("NS.core.Application", a);
})};

I know it isn't a good decision, but I could find another way to solve the problem.