I have been looking everywhere and cannot find a clear answer. I want to create one function that is able to tell the name of the object that called it.
<JavaScript>
function myFunc(e){
console.log(e.data.Name);
}
module.exports = {
myFunc
}
</JavaScript>
<Button ux:Name="TestID" Text="Click me" Clicked="{myFunc}" />
I need to call that same function from several buttons and then run logic depending on what button called it. Can anyone help? I searched for Parameters and a lot of it had to do with passing data between pages but this is the same page.
When you put a nested Callback inside of a Clicked trigger, your callback function will contain the ux:Name of the trigger container (Button in this case) in args.sender.