Can I fire events using Javascript?
I want to know how to fire an event that belongs to a component, from Javascript.
I am using the Search component in my app. It works fine and does all the stuff I need it to do. From a usability perspective it leaves much to be desired. Why should the user have to close the keyboard and then try to touch the tiny little magnifying glass to Fire the Search event.
So now I am capturing key presses with
if (event.keyCode == 13) { //do something to fire the 'Search' event on the Search component }
However, I don't know now to fire the Search event from Javascript.
I hate to have to duplicate code which already exists for the Search event (also bad for maintenance). Can I use something like .tigger() or .fireEvent() or something else?
Thanks for your help.