Add Config - part 1

Let's contiue by allowing the user to select options. Since we already use jQuery, we're going to use Select2arrow-up-right as well. Feel free to use any other alternative. We are going to use select2@4.0.13arrow-up-right for this example.

<link href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script>

Let's add a select box above the file input. We will name this selectedEntitesInput.

<!-- Input -->
<select
    id="selectedEntitesInput"
    name="selectedEntites[]"
    multiple="multiple"
    style="width: 100%"
    required
></select>
<input type="file" id="myIfcFile" onchange="myFunction()" />

Let's configure select2. We're going to load our data from an arrayarrow-up-right.

$(document).ready(function () {
    // select2
    $("#selectedEntitesInput").select2({
        data: data,
        placeholder: "Select which entities to include",
    });
});

Here's a staring template. Again, a list of IFC building elements can be found herearrow-up-right.

circle-check

Last updated