首页 > 解决方案 > 切换模型时更新数据面板

问题描述

我有一个与我的 Autodesk 帐户链接的应用程序,并且我还有一个面板仪表板,可以从当前模型加载数据,问题是当我在集线器中选择另一个模型时,该面板没有更新。

我试图找到Autodesk.viewing.EVENT可以记录此步骤的,但我不能。他们都试过了,都没有成功……

Autodesk.Viewing.GEOMETRY_LOADED_EVENT,

Autodesk.Viewing.OBJECT_TREE_CREATED_EVENT,

Autodesk.Viewing.MODEL_ADDED_EVENT...

在此处输入图像描述 在此处输入图像描述

标签: javascripteventsautodesk-forgedashboardviewer

解决方案


我有这个工作。不用担心事件,它工作正常。这是我的更改和补充: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 需要是唯一的。


推荐阅读