I am trying to dynamically create a picklist in a lightning component which aligns with the lightning design system look and feel. The lightning design system says that we should create it as given in link below.
https://www.lightningdesignsystem.com/components/menus/#flavor-picklist
I want to add list item elements from the helper on the fire of init method. I am receiving these items as a response of an apex controller call from the helper. However, when I am trying to modify the innerHTML of the list and add the response items as list items it is not rendering them.
I am doing it like
var action = component.get(ApexCall);
var self = this;
action.setCallback(this, function(actionResult) {
var family=actionResult.getReturnValue();
var famLength=family.length;
var listDOM = document.getElementById("familyList");
var j= listDOM.innerHTML;
j=j+'<li id="menu-40-0" class="slds-dropdown__item"> <a href="javascript:void(0);" role="menuitemradio"> <p class="slds-truncate">';
j=j+'<c:svg ariaHidden="true" class="slds-icon slds-icon--selected slds-icon--x-small slds-icon-text-default slds-m-right--x-small" xlinkHref="/assets/icons/utility-sprite/svg/symbols.svg#check"/>';
j=j+family[0]+'</p> </a> </li>"';
Could anyone tell me how to make it work?