0

Im using Isotope with a large dataset and I would like to limit the number of displayed results.

If I have a text filter like this:

$container.isotope({ filter: function() 
{
  var text = document.getElementById('searchTerm').value;
  var filter = new RegExp("^"+text, "i");

  return tag.match(filter);
});

How can I set this limit?

Thank you

SaP
  • 1
  • 1

1 Answers1

0

you really should use ajax, even if you will resolve this, which probably you can by simply doing a count in the DOM and hiding the elems and toggling their show/hide state when filtering, you will still load all of them at once. While if you use ajax then you load X number and then do append or insert with isotope each time with a load more button. Other wise you can use lazy load and this SO answer

Community
  • 1
  • 1
rob.m
  • 8,256
  • 14
  • 65
  • 119