【问题标题】:Update datapanel when the model is switched切换模型时更新数据面板
【发布时间】:2021-06-22 06:02:00
【问题描述】:

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

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

Autodesk.Viewing.GEOMETRY_LOADED_EVENT,

Autodesk.Viewing.OBJECT_TREE_CREATED_EVENT,

Autodesk.Viewing.MODEL_ADDED_EVENT...

【问题讨论】:

    标签: javascript events autodesk-forge dashboard viewer


    【解决方案1】:

    我已经完成了这项工作。不用担心事件,它工作正常。 以下是我的更改和补充: PanelBarChart.js(饼图也一样)

    loadWithCustomProperty(property) {
        this.propertyToUse = property;
        this.chart.destroy();
        this.drawChart();
    }
    

    在dashboard.js中创建列表后,添加change事件:

    $('#'+_this._selectcontainer).change(function() {
            console.log($('#'+_this._selectcontainer+' option:selected').text())
            _this._panel.loadWithCustomProperty($('#'+_this._selectcontainer+' option:selected').text())            
        });   
    

    这里 _this._selectcontainer 是 UUID,因为你要添加多个字符,所以 id 需要是唯一的。

    【讨论】:

    • 感谢 varunpatil。我不明白......你是什么意思_this._selectcontainer?您指的是何时选择或更改“userhubs 面板”?
    • 它是select html元素的id。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-22
    • 2012-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多