Forum Discussion
ysapiyev
8 years agoResponsive Resident
Trouble with adding checkbox
Hi everyone, I wanted to add checkbox and tried this code: svg.selectAll("foreignObject")
.data(nodes)
.enter().append("foreignObject")
.attr('x' , o.x)
.attr('y'...
v-viig
8 years agoCommunity Champion
Hi ysapiyev
At first, you should include the second body tag since iframe already has it.
The input tag can be added by using d3.append method.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- v-viig8 years agoCommunity Champion
You might use something like this code snippet:
d3.select(Your_Root_Element) .append("input") .attr({ type: "checkbox" });Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- ysapiyev8 years agoResponsive Resident
I tried something like this:
let input1 = this.svg.append("input") .attr({ type: "checkbox", x: 200, y: 50 });However, nothing is shown. What can be wrong?
- v-viig8 years agoCommunity Champion
Does this.svg contain an svg element?
Checkbox can be used only in HTML elements such as div, table, footer, etc.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals