I want to create a Lightning component where i can define some custom actions which can be used by the component which is creating instance. It will be very similar to the onrowselection, onsort actions on lightning:datatable or onclick of lightning:button.
Anybody knows whether it possible for custom components in lightning, if yes then how?
Best Answer
You can pass a reference to the parent into the child, so in the parent component:
and in the child component you can then invoke the parent method:
This can sometimes be cleaner than using a component event that others have commented about. But best to learn about both techniques.