metafizzy / isotope

:revolving_hearts: Filter & sort magical layouts
https://isotope.metafizzy.co
11.03k stars 1.42k forks source link

Vertical Only Positioning? #1646

Open MikeiLL opened 1 year ago

MikeiLL commented 1 year ago

I posted this question on StackOverflow, which may be a more appropriate venue for it:

https://stackoverflow.com/questions/75011976/isotopejs-with-vertical-only-positioning-updates-possible

Isotope JS will probably work nicely to filter events in a calendar-style display, but the trouble is getting it to keep items in the appropriate column.

The problem, when items for tues-thursday are filtered out:

|monday|tuesday|wednesday|thursday|friday|saturday|
---------------------------------------------------
| mon 1| fri 1 | sat 1 |

My config:

var iso = new Isotope( '.schedule tbody', {
  itemSelector: 'td',
  layoutMode: 'masonry',
  resize: true
});

And a Codepen example.

Thinking maybe fitColumns is the tool, but the .arrange method doesn't seem to work in that layout mode:

var iso = new Isotope(".schedule tbody", {
  layoutMode: 'fitColumns',
  itemSelector: '.grid-item'
});

...

iso.arrange({ filter: filterValue }); // nothing

Another codepen.

Any suggestions?