var pane = d3.selectAll(".RFPane")
.data(labels);
Now, if I understand correctly, you want to add a select element to
each subpane, using the options from the pane's datum. Since you're
using selectAll (there are multiple elements), the subpanes will not
automatically inherit the data from the pane. If you know that there
are always two subpanes per pane, you can duplicate the data:
var subpane = pane.selectAll(".RFSubPane")
.data(function(d) { return [d, d]; });
Now you can create the select element, and by expanding the data
array, the child options:
subpane.append("select").selectAll("option")
.data(function(d) { return d; })
.enter().append("option")
.text(function(d) { return d; ]);
Mike
P.S. If there are a variable number of subpanes, you could use
pane.each to create a context where you can access the parent data,
maybe like this:
pane.each(function(d, i) {
var subpane = d3.select(this).selectAll(".RFSubPane");
});
In this case, you don't actually need to bind data to the subpanes,
and you can say selectAll("option").data(d) rather than using a
function.