javascript - 切换模型时更新数据面板
问题描述
我有一个与我的 Autodesk 帐户链接的应用程序,并且我还有一个面板仪表板,可以从当前模型加载数据,问题是当我在集线器中选择另一个模型时,该面板没有更新。
我试图找到Autodesk.viewing.EVENT
可以记录此步骤的,但我不能。他们都试过了,都没有成功……
Autodesk.Viewing.GEOMETRY_LOADED_EVENT
,
Autodesk.Viewing.OBJECT_TREE_CREATED_EVENT
,
Autodesk.Viewing.MODEL_ADDED_EVENT
...
解决方案
我有这个工作。不用担心事件,它工作正常。这是我的更改和补充:PanelBarChart.js(饼图也是如此)
loadWithCustomProperty(property) {
this.propertyToUse = property;
this.chart.destroy();
this.drawChart();
}
在dashboard.js 中创建列表后,添加更改事件:
$('#'+_this._selectcontainer).change(function() {
console.log($('#'+_this._selectcontainer+' option:selected').text())
_this._panel.loadWithCustomProperty($('#'+_this._selectcontainer+' option:selected').text())
});
这里 _this._selectcontainer 是 UUID,因为您要添加多个字符,所以 id 需要是唯一的。
推荐阅读
- ffmpeg - ffmpeg 将 mp4 视频转换为 rgba 流
- tensorflow2.0 - 如何使用 tensorflow 的 FFT?
- c - fprintf 的堆缓冲区溢出
- javascript - 在我的 express API 项目的其他文件夹中使用时,特定文件夹中的 sqlite3 sql 查询函数不起作用
- spring - 为什么大多数 Spring 应用程序的根级文件夹似乎总是遵循 com/company 命名约定?
- android - 你能得到日期选择器的标签吗
- javascript - 在 JavaScript 中使用 ml5.js 如何返回 resultP.html?
- ffmpeg - FFMPEG:如何确定特定硬件加速上下文支持哪些过滤器?
- r - 如何在ggplot2中切换轴排序
- kubernetes - 如何将 volumeClaimTemplates 提取到单独的 PersistentVolumeClaim yaml 文件中?