You need to sign in to do that
Don't have an account?
Sumesh Chandran
Pass values from controller.js to helper.js!
Hello all,
Totally new to Javascript.
I am trying to pass values from the controller.js to the helper.js file. Here in the below code I am trying to pass the 'selectedRecordId' and the 'selectedButtonLabel' variable to the helper.js file. Not sure how to do it in JS.
Here is my controller code:
Please advise!
Thanks
Totally new to Javascript.
I am trying to pass values from the controller.js to the helper.js file. Here in the below code I am trying to pass the 'selectedRecordId' and the 'selectedButtonLabel' variable to the helper.js file. Not sure how to do it in JS.
Here is my controller code:
({ handleRowAction :function(component, event, helper){ var selectedButtonLabel = event.getSource().get("v.label"); var selectedRecordId = event.getSource().get("v.value"); helper.updateOppStage(component, event, helper); } })Here is my helper code:
({ updateOppStage : function(component, event, helper) { var action = component.get("c.findById"); } })Here is my apex code:
public class OppsListApexController { @AuraEnabled public static Opportunity findById(String oppId) { return [select Name, CloseDate, StageName, sumchans__OppOwner__c from Opportunity where id=:oppId]; } }
Please advise!
Thanks
Controller
helper
All Answers
Controller
helper