/
Improving ListManager JS class
Improving ListManager JS class
Each website most likely would consist of pages of these 3 types:
- content page - page, content comes user content blocks entered by website administrator
- list page - shows items from a database (e.g. articles, products, etc.)
- detail page - shows more details about an individual item from the list
This discussion is about "list pages" only. Main problem with lists right now is that a full page reload happens on any of these user actions:
- going to another page in same list (e.g. user was on 2nd page and wants to go to 5th page)
- changing sorting (e.g. items were sorted by name and now needs to be sorted by price)
- filter change (all items were displayed, but user needs to show ones with price in a particular range)
While developing Modern Store
theme (not released yet) for In-Commerce we've created ListManager
class that is specifically designed to solve all of these problems. Class works in general and does it's job, but since we never used it outside Modern Store
theme some of design problems were not discovered early.
For example right now it has some predefined filter set and no way to connect new filters to it. I propose to:
- add pluggable architecture to ListManager class, that would allow to connect new filters of any complexity to it without need to rewrite ListManager class
- move existing filters to a plugin, which is only used, when needed
This not only will ease understanding of class's code, but also helps in it's future development.