html:
<select id=”userMenu”><option value=””>– Please select –</option></select>
js:
d3.select(“select#userMenu”)
.on(‘change’, function() {
updateCheckboxes();
})
.selectAll(“option:not(:first-child)”)
.data(data)
.enter()
.append(“option”)
.attr(“value”, function(d) {return d.id; } )
.html( function(d) {return d.firstName + ‘ ‘ + d.lastName + ‘(‘ + d.id + ‘)’; } );