tbranyen / hyperlist

A performant virtual scrolling list utility capable of rendering millions of rows
Other
444 stars 44 forks source link

How to use jQuery plugins on each view item? #66

Open trusktr opened 3 years ago

trusktr commented 3 years ago

What's the recommended way to use jQuery plugins on the items in the view?

eads commented 3 years ago

I imagine you'd just call them in the generate function. A simple non-jquery example:

//  ...
    generate(index) {
      const el = document.createElement("div");
      el.textContent = "click me";
      el.onclick = () => {
        console.log("clicked");
      };
      return el;
    }

Hope that helps!