PDA

View Full Version : Application not launching if I Ext.require a simple file



bareflix
8 Jul 2012, 7:24 AM
I'm using extjs 4.1.0 and have noticed a change from extjs 4.0.

I have an application that works fine. At the start of the app.js file, I have an Ext.require with a list of files. If I add:
'app.Test' to the require list, the application fails to launch.
All app.Test contains is:

console.info ("in test");

I see the "in test" message, but the application launch() function is never called.
If I take app.Test out of the list, it works fine.

There are no errors on the console.

Any ideas what's going wrong or how to debug this?

skirtle
8 Jul 2012, 7:58 AM
Does it work if you define the class app.Test inside the file?

The requires mechanism is for specifying classes, not files. If the class does not exist after the file is loaded it'll cause a failure.

skirtle
8 Jul 2012, 8:00 AM
Which ExtJS file are you using? I would expect to see an error message with ext-all-dev.js.

bareflix
8 Jul 2012, 8:31 AM
I was using ext-debug.js. Now I do get an error message if I use ext-all-dev.js.

In extjs 4.0.x, it was not manditory to create a class in the required file. I was using the required mechanism to include my ext-direct API definition so it would be combined and minified into app-all.js.

Is there any way to do this with 4.0.1?
Basically I just need a mechanism to add arbitrary js code to be minified.

scottmartin
12 Jul 2012, 2:12 PM
Basically I just need a mechanism to add arbitrary js code to be minified.

I would think this would be the job of the SDK (or you minify lib) to perform this?

Scott.