Skip to content Skip to sidebar Skip to footer

Best Practices With Infinity.js

I am using AirBnb's infinity.js plugin to generate an infinite list in my app. I generate the list the first time on the create of the concerned page. But then the list has to upda

Solution 1:

I don't if it's good practices, but for now I am doing this :

function resetModelsListView(prodata, firsttime, funfeatureOn, specificBrand, specificPro) {
 ...
 //USING INFINITY.JS:

 //clear previous list
 if (typeof listView !== 'undefined') {
    listView.remove();
    listView.cleanup();
 }

 //reinit the list
 var $el = $('#modelsListview');
 listView = new infinity.ListView($el);

 //adding new content:
 var $newContent = $(optionsmodel);
 listView.append($newContent);
}

Post a Comment for "Best Practices With Infinity.js"