extjs - 未找到 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”节点模块不包含在项目中。
我究竟做错了什么?
谢谢!
解决方案
对于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
推荐阅读
- javascript - 您将如何提取 2 个数字并将它们存储到字符串中的单独变量中
- node.js - 似乎无法自动完成在 WebStorm 中工作
- django - 在 django 中执行“python manage.py runserver”时出现问题
- javascript - 在嵌套对象中查找对象:超出最大调用堆栈大小
- ios - 从 NSDictionary 获取值时出错
- surface - 从一组 3D 点生成 OPEN 曲面网格
- git - Git 获取用户名和密码
- css - 如何在有序列表的项目之间添加空行?
- python - Terminate a Python script after a time period
- python-3.x - 遍历文件夹时如何跳过整个文件?