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>
4

1 回答 1

2

这两个文件不一样。ext-debug-all.js = ext-all.js, 和ext.js = ext-debug.js. 这些all文件包含整个框架,而其他文件包含框架所需的核心文件。如果您使用 Sencha 命令进行完整构建,则应该使用这些文件,并且您的requiresuses指令都是正确的。

如果你app-all.js像你说的那样创建文件,那么你不需要在你的 jsp中包含任何Ext 文件。app.all拥有您需要的整个 js 主体,包括所需的 ExtJS 框架文件。

于 2013-09-20T15:23:28.990 回答