PDA

View Full Version : Problem with sencha create jsb using Ext Js 4 - classes missing in app.jsb3



nonie
21 Feb 2012, 9:22 AM
Hi,

We are having a problem with the sencha create jsb command for our project - we run the command against our application deployed on a server - the command runs without any issues but many of the required classes are missing from the app.jsb3.

Based on this I tried to run the command against the code downloaded for the Panda example for MVC Architecture and it seems to have the same issues - the only two classes included in the .jsb file are

{
"path": "app/model/",
"name": "Station.js"
},
{
"path": "app/store/",
"name": "Stations.js"
}





I am using version 1.2.3 of the SenchaSDKTools on windows with version 4.0.7 of Ext js

I have seen it mentioned on the forum that the app.js file needs to be in the same folder as the index.html file (which it is not for the Panda example) I have tried to change this but it did not change the output.

Running the command with the verbose flag (-v) just prints out the .jsb file so this does not give us any additional information.

Thanks,

Ronan

rajivpa78
21 Feb 2012, 11:02 AM
Facing similar issue, after long hours of debugging.. narrowed it to following

- When you declare your models / stores in app.js the Sencha Build tool doesnt include any other classes except for the single model /store.
If you move the declaration of your models / stores to your controllers the Sencha Build tool works fine, however for me when I do this the instance of store available in controller (via getXXXStore()) method is not usable (even though autoLoad is on)

Can somebody please help..

Thanks
Rajiv

rbail2000
7 Mar 2012, 3:26 AM
Thanks Rajiv, You saved my day.

regards
Ravi

Facing similar issue, after long hours of debugging.. narrowed it to following

- When you declare your models / stores in app.js the Sencha Build tool doesnt include any other classes except for the single model /store.
If you move the declaration of your models / stores to your controllers the Sencha Build tool works fine, however for me when I do this the instance of store available in controller (via getXXXStore()) method is not usable (even though autoLoad is on)

Can somebody please help..

Thanks
Rajiv

rajivpa78
7 Mar 2012, 4:00 AM
Glad it helped.

Few more findings
1. If your index.html has ext-all.js / ext-all-debug.js the resulting jsb3 will be empty. Make sure before the build index.html is switched to have ext.js or ext-debug.js

2. If the generated app-all.js is not compressed, its because Sencha build tool doesnt like stray commas within your source code. Review your source code to make sure there is no comma after the last element of array, no comma after the last variable in an object etc.. in general try to eliminate all the warnings reported by IDE ( eclipse with javascript validations enabled in our case)

3. As reported earlier the store/model declaration should happen in controllers for build to work, however if you find that stores are not initialized when you are trying to populate your views from controller, then move your populate code to the on load event of store.

4. Once your build is successful and you include app-all.js + ext.js, you can see that still there are network calls made for few of the Ext framework classes. One work around is to include ext-all.js instead of ext.js to eliminate all such stray calls. That may come at cost of having redundant ext classes in ext-all.js & app-all.js.. but in our case the network time saved was worth it.

boofman15
8 Mar 2012, 1:14 PM
Thanks rajivpa78 for posting this information. Very helpful!