0

Using anything but the ext-debug.js file in my index.jsp is breaking my Ext Js 4.2 application.

I don't understand why this is happening, because, as I read, the ext-all.js file should be used on the production version of my application. It contains the whole framework in a single compressed file, so it should be faster.

So what I do is this: I create the app.jsb3 file, then the app-all.js file (using Sencha Tools 2.0 commands), then I edit the index.jsp file and change from

<script type="text/javascript" src="extjs/ext-debug.js"></script>

to

<script type="text/javascript" src="extjs/ext-all.js"></script>

Then I start the application and I got an error, although running it before the change works fine. I also tried with ext-debug-all.js and ext.js, every time I get a distinct error. Did anyone have this kind of issue?

Thanks in advance for your answers. This is my index.jsp file:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Title</title>

    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all-neptune.css" />
    <link rel="stylesheet" type="text/css" href="resources/css/desktop.css" />
    <link rel="stylesheet" type="text/css" href="resources/css/nc-custom.css" />
    <link rel="stylesheet" type="text/css" href="resources/css/modules.css" />
<!--     <script type="text/javascript" src="extjs/ext-all.js"></script> -->
<!--     <script type="text/javascript" src="extjs/ext-theme-neptune.js"></script> -->
    <script type="text/javascript" src="app-all.js"></script>
</head>

<body>
</body>

</html>
niceman
  • 161
  • 1
  • 3
  • 11
  • please could you give more details on how it breaks your application ? what errors you get ? – Gar Sep 20 '13 at 13:18
  • Thank you for your quick response. But does it matter? I mean the two files should contain the same thing, right? Anyway, the error appears in a file I use to customize a grid, and it sounds something like: Cannot run getAction of undefined. But how come this is working using ext-debug.js? – niceman Sep 20 '13 at 13:24
  • The problem is obviously elsewhere, perhaps your ext-all.js altered in some ways, the error might give a hint. – Gar Sep 20 '13 at 13:56
  • Could give some advice, what should I do? – niceman Sep 20 '13 at 14:00
  • i really lack the necessary info to point you to some direction, please provide the of the page you having an error in, and try showing the error (from the javascript console). – Gar Sep 20 '13 at 14:04
  • Also I'm getting some warnings like "[Ext.Loader] Synchronously loading 'app.module.tools.ToolsModule'; consider adding Ext.require('app.module.tools.ToolsModule') above Ext.onReady " on some stores, maybe this will help. – niceman Sep 20 '13 at 14:06

1 Answers1

2

Those 2 files are not the same. ext-debug-all.js = ext-all.js, and ext.js = ext-debug.js. The all files contain the entire framework, whereas the other files contain the core files needed by the framework. Those files should be used if you are doing the full build using Sencha Command, and your requires and uses directives are all correct.

If you are creating the app-all.js file like you say, then you should not need to include any Ext files in your jsp. The app.all will have the entire body of js that you need, including the required ExtJS framework files.

kevhender
  • 4,285
  • 1
  • 13
  • 16
  • I edited the above code and added the content of the index.jsp file. I commented the 2 lines as I understood from your explanations. When I start the application I get Uncaught ReferenceError: Ext is not defined in the app-all.js. Any ideas? Thank you – niceman Sep 23 '13 at 08:34
  • How are you building app-all.js? – kevhender Sep 23 '13 at 11:18
  • Using the Sencha Tools 2.0 commands: $ cd C:\pathtoapp...\webapp NEWLINE $ sencha create jsb -a http://localhost/dologin -p app.jsb3 NEWLINE $ sencha build -p app.jsb3 -d . – niceman Sep 23 '13 at 12:07
  • Don't think I'll be able to debug what is happening from afar, but you should really consider upgrading to a newer version of Sencha Command. They have made essential improvements in the past year+ since v2.0. – kevhender Sep 23 '13 at 13:15
  • It is impossible for me to upgrade, it's a huge application, very customized, so the only way is to use Sencha Tools 2.0, and I am not allowed to change anything, just have to create the production file. Thanks for your help, anyway. – niceman Sep 23 '13 at 13:24