Create a Table

Let's output our result to a table using DataTables.

<table class="table table-hover" id="ifcTable" width="100%"></table>

We need to populate the table ourselves... this might be a bit tricky to do. Here's an example to help you get started. See Ajax sourced data for more information.

var data = [];
Object.values(ifcEntites).forEach((entity) => {
    Object.keys(entity.properties).forEach(
        (propertySet) => {
            Object.keys(
                entity.properties[propertySet]
            ).forEach((property) => {
                data = [
                    ...data,
                    [
                        entity.instanceName,
                        entity.attributes.parsed[0],
                        entity.entityName,
                        entity.attributes.parsed[2],
                        propertySet,
                        property,
                        entity.properties[propertySet][
                            property
                        ],
                    ],
                ];
            });
        }
    );
});

Last updated