[SalesForce] How to call a javascript function in the component

i have a javascript function that i wish to run after the component is loaded.
this is the function:

higlightCurrentRecordId : function(component, event, helper) {
    var id=component.get("v.idforHighlight");   

    var e=document.getElementById(id);    

    var node = document.createElement('div');        
    node.innerHTML = '<label class = "redDot" >&#9679;</label>';       
    e.appendChild(node);    
},

how can i trigger this function after the component is done loading?

please advise

Best Answer

you may use Afterrender In RENDERER Section

({
afterRender: function(component, helper) {
   this.superAfterRender();
   helper.higlightCurrentRecordId(component);
}
})
Related Topic