我正在尝试使用 Sencha GXT 3.1 beta 在 GWT 2.6 中实现 BarChart。 它编译得很好,但我确实得到了几个
14:40:40.102 [错误] [comav200] 第 71 行:没有可用于 com.sencha.gxt.chart.client.chart.Chart 类型的源代码;您是否忘记继承所需的模块?
错误。我确实使用 import com.sencha.gxt.chart.client.chart.Chart; (还有更多)。 有人对为什么会发生这种情况或我忘记了什么有任何想法吗?
最诚挚的问候, 凯莱
最佳答案
请验证gwt.xml
中的以下继承
<inherits name='com.sencha.gxt.chart.Chart' />
有关详细信息和基本图表示例,请查看
<强> Getting started with GXT charts
<小时/>如果您不想转到上述链接,请复制该链接。
项目模块设置
使用图表需要将库添加到 GWT 项目 xml 模块中。
将com.sencha.gxt.chart.Chart
添加到GWT项目模块:
<inherits name='com.sencha.gxt.chart.Chart' />
Project.gwt.xml
模块示例:(这是一个完整的示例,其中大部分是可选的。)
请验证您的gwt.xml
<!-- Project.gwt.xml module file -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd">
<module rename-to='project'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Other module inherits -->
<inherits name='com.sencha.gxt.ui.GXT' />
<!-- Add this for using GXT charts -->
<inherits name='com.sencha.gxt.chart.Chart' />
<!-- GXT Stylesheet -->
<stylesheet src="reset.css" />
<!-- Override the blue theme -->
<inherits name="com.sencha.gxt.theme.gray.Gray" />
<!-- Specify the app entry point class. -->
<entry-point class='com.sencha.gxt.project.client.ProjectEntryPoint' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>
关于java - Gwt 和 Sencha,你们忘记继承一个必需的模块了吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23695647/