I add/remove rows dynamically in Lightning component. First row shows by default with plus button. Onclick plus button - adds row 2,3,4,etc., On first row Project picklist loads with values. But on 2nd, 3rd rows picklist value is not loading even though i call the same function which returns picklist value on the first row.
<td>
<div class="slds-select_container">
<ui:inputSelect aura:id="projectId" class="slds-select"/>
</div>
</td>
getemployeeProjects: function(component) {
var parentId = component.get("v.userEmpRecdId");
var action = component.get("c.getEmpProject");
action.setParams({
"empRecdId": parentId
});
var opts = [];
action.setCallback(this, function(response) {
console.log('test === pick'+JSON.stringify(response.getReturnValue()));
var allValues = response.getReturnValue();
if (response.getState() == "SUCCESS") {
var allValues = response.getReturnValue();
if (allValues != undefined && allValues.length > 0) {
opts.push({
class: "optionClass",
label: "--- None ---",
value: ""
});
}
for (var i = 0; i < allValues.length; i++) {
opts.push({
class: "optionClass",
label: allValues[i],
value: allValues[i]
});
}
console.log('test opts=='+opts);
component.find('projectId').set("v.options", opts);
}
});
$A.enqueueAction(action);
},
I get the below warning message in the console. Please help me fix the issue.