extjs,使用GeoExt构建的sencha

时间:2014-06-04 18:10:12

标签: extjs geoext

我有一个使用

构建的MVC应用程序
sencha app build production

在这个应用程序中我使用外部类(在我的例子中是GeoExt.panel.Map)并且sencha命令失败并带有异常

com.sencha.exceptions.ExNotFound: Unknown definition for dependency : GeoExt.panel.Map

有人知道如何修理吗?


内容添加于2014年6月21日21:17

请注意,我创建了一个名为bootstrap.GeoExt.js的文件,其内容可以引用GeoExt的所有来源:

Ext.Loader.addClassPathMappings({   
    "GeoExt": "../../../../../GeoExt/geoext2-2.0.1/src/GeoExt"
});

此文件在index.html

中引用
<!DOCTYPE HTML>
<html>
<head>    
    <meta charset="UTF-8">
    <title>TestComplete</title>
    <script src="http://openlayers.org/api/2.13.1/OpenLayers.js"></script>
    <link rel="stylesheet" href="custom.css">
    <!-- <x-compile> -->
        <!-- <x-bootstrap> -->
            <link rel="stylesheet" href="bootstrap.css">
            <script src="ext/ext-dev.js"></script>
            <script src="bootstrap.GeoExt.js"></script>
            <script src="bootstrap.js"></script>
        <!-- </x-bootstrap> -->
        <script src="app.js"></script>
    <!-- </x-compile> -->
</head>
<body></body>
</html>

1 个答案:

答案 0 :(得分:0)

这就是我在ST应用程序打包中包含“额外”文件的方式

一旦我尝试构建生产我的ST应用程序但我使用静态json文件(用于原型设计)并且我的主文件夹中有一个数据文件夹,问题是数据文件夹没有包含在包装中,我修改了它修改了 build.xml (在你的应用程序的主文件夹中)我添加的结尾:

<copy todir="${build.dir}/data/" overwrite="true">
      <fileset dir="${basedir}/data/"> //this is your main app folder 
        <include name="**/*" />
      </fileset>
</copy> 

之后我的数据文件夹包含在我的生产版本中。

最好的问候。