Search code examples
autodesk-viewer

How to add a second column of values in the properties panel?


I created a property panel that displays the properties of the selected item. The property panel contains a category, property names and their values. I want to add a second column of values, but I do not know how to do this. Here is my extension code.


Solution

  • You can extend the original PropertyPanel.prototype.displayProperty and create another div right next to the default one:

    YourPropertyPanel.prototype.displayProperty = function (property, parent, options) {
        Autodesk.Viewing.Extensions.ViewerPropertyPanel.prototype.displayProperty .call(this, property, parent, options); //if you'd like to keep the existing column
    
        var yourSecondColumn= document.createElement('div');
        ...//set up your column
        parent.appendChild(yourSecondColumn)
    })