Created
May 28, 2018 16:27
-
-
Save tushar30/fbe00c1d33d43873b2ee46445499ff6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
doInit : function(component, event, helper) { | |
var sobject = component.get('v.objName'); | |
var fieldName = component.get('v.fieldName'); | |
var formatText = component.find("fielddata"); | |
if(!fieldName.includes('.')) { | |
formatText.set("v.value",sobject[fieldName]); | |
} | |
else { | |
console.log(sobject[fieldName.split(".")[0]]); | |
formatText.set("v.value",sobject[fieldName.split(".")[0]][fieldName.split(".")[1]]); //Here we are fetching data from parent field | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment