To use a plugin you need two things:
Include it when you instantiate List.js
new List('list-id', {
plugins: [ ListPagination(), NameOfOtherPlugin(options) ]
});
It is also possible to add options and load multiple instances of the same plugins (if the plugin itself allows it).
If the property name
is added in the plugin option
parameter does the plugin become
accessible through listObj.namePropertyValue.This is useful when having multiple instances of the same plugin.
var myList = new List('list-id', {
plugins: [
ListPagination({ name: "topPagination", paginationClass: "top-pagination" }),
ListPagination({ name: "bottomPagination", paginationClass: "bottom-pagination" })
]
});
console.log(myList.topPagination);
console.log(myList.bottomPagination);
Go to: /docs/plugins/build