首页 > 解决方案 > 未找到 Ext.grid.Tree

问题描述

我正在尝试在我的 ExtJs 项目中使用 Ext.grid.Tree。但看起来'tree'组件默认没有添加到extjs项目中。

我使用“ext-gen app -i”创建了新的 ExtJs 应用程序

然后我将“需要:['Ext.grid.Tree']”添加到 MyExtGenApp.Application。尝试构建应用程序“sencha app build”并得到一个错误:

[ERR] D:\WORKSPACES\my-ext-gen-app\node_modules\@sencha\cmd\dist\plugin.xml:333: The following error occurred while executing this line:
D:\WORKSPACES\my-ext-gen-app\node_modules\@sencha\cmd\dist\ant\build\app\build-impl.xml:387: The following error occurred while executing this line:
D:\WORKSPACES\my-ext-gen-app\node_modules\@sencha\cmd\dist\ant\build\app\init-impl.xml:436: com.sencha.exceptions.ExBuild: Failed to find any files for D:\WORKSPACES\my-ext-gen-app\app\desktop\src\Application.js::ClassRequire::Ext.grid.Tree

除了“需要:['Ext.grid.Tree']”之外,我没有更改任何内容。

看起来“ext-modern-treegrid”节点模块不包含在项目中。

我究竟做错了什么?

谢谢!

标签: extjsextjs7

解决方案


对于modernt 工具包,如文档中所述Ext.tree.Grid需要单独的NPM 包@sencha/ext-modern-treegrid。

因此,您必须安装它npm i --save @sencha/ext-modern-treegrid并将其名称“treegrid”添加到 app.json 中的 requires 中(您在 \node_modules\@sencha\{package}\package.json, "sencha" 部分检查 ExtJS 包名称):

"requires": [
    "treegrid"
],

这应该可以修复以下错误:

无法解决依赖 Ext.grid.Tree

com.sencha.exceptions.ExNotFound:依赖项的未知定义:Ext.grid.Tree


推荐阅读