patrickkunka / mixitup

A high-performance, dependency-free library for animated filtering, sorting, insertion, removal and more
https://www.kunkalabs.com/mixitup/
4.52k stars 734 forks source link

Appended mix items respect the currently set sorting option in Multifilter Plugin #574

Open Reza-Eskandari opened 3 years ago

Reza-Eskandari commented 3 years ago

Hi!👋 I'm appending some fetched items from an ajax call to the mix-container but if the user had already selected a sorting option (let's say "price:asc") the appended items don't sort based on that selected sorting option and get appended in the container based on their default sorting option. Somehow the appended items respect the currently set filter options and get shown if they match the selected filter options. How do I resort the items after appending the items in the mix-container? I'm using the multifilter extension but not using the dataset api. is there a way to achieve this without incorporating the dataset api?

I've tried this but this doesn't seem to be working:

mixer.append(new_product_cards,false)
 .then(function(state) {
    mixer.sort(mixer.getState().activeSort.sortString, false)
 });