Hello,
I have an svg string that I'd like to add to a widget. How do I go about doing that? I'm using WAB 2.2 with a Jewelry Box theme.
Thank You Greg
Greg,
What doe mean you want to use a SVG string? SVG files can be used in a CSS rule as a background-image for a button or div.
i.e.:
.jimu-widget-layerList .jimu-dropmenu .jimu-icon-btn{
width: 22px;
height: 22px;
min-width: 13px;
background-image: url("../images/more_normal.svg");
background-color: rgba(255, 255, 255, 0);
border: 0 solid;
}
Hi Robert,
I resolved this on my own.
I changed the html by adding another div
<div>
<div id="svgContainer"></div>
</div>
Then I added it to the widget using JQuery
var svg = MyFunctionReturnedSVGString;
$('#svgContainer').html(svg);
Greg