monkberry / events

Add events handling to Monkberry views.
3 stars 0 forks source link

How to use jquery event delegation? #2

Open muthumani-prabhu opened 7 years ago

muthumani-prabhu commented 7 years ago

Hi @antonmedv

What if I want to use jquery event delegation instead of monkberry-events? what is the best approach from your point of view? Though I have had success in delegating events using jquery. But still would like to consider your words on this.

With jquery, I tried the below approach $(this.nodes).on("click", '#gs-show-search', this.showSearch.bind(this))

Thanks mani

antonmedv commented 7 years ago

Hi, this approach is ok, just add top listener to root container or root nodes.