I'm using list.js library (http://www.listjs.com/), to sort some tables. I want to know if it is possible to get a default sort when page loads without click nothing.
Lets say you initialize your list like so:
var myList = new List('my-list', {
valueNames: ['mySortableClass1', 'mySortableClass2', 'mySortableClass3']
});
Simply call this right after that block:
myList.sort("mySortableClass1", {
order: "desc"
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With