Vestride / Shuffle

Categorize, sort, and filter a responsive grid of items

Home Page:https://vestride.github.io/Shuffle/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question - Custom filter for max item number

Nightshadelink opened this issue · comments

          I don't think there's an easy way to do this. You'll have to use custom filters and a counter to hide any item that's past your visible counter.

Originally posted by @Vestride in #270 (comment)

How would such a Filter work? Say i have this:

function handleFilterChange(evt) {
  var input = evt.currentTarget;
  if (input.checked) {
    myShuffle.filter(input.value);
    myShuffle.sort(options);
  }
}

which filteres on value on click of the coresponding button but i want to cap the max item number to 3