Page 1 of 1
Additional Sorting and Pagination for licensing list
Posted: 10 January 2024, 04:53
by Andrew Bowns
Software developer new to BGA Studio and I'm looking for a low complexity game to start. It would be really nice if you could use the column headers of the table to sort by any column. Also with the length of the list it would be nice to have some pagination to make it more easily digestable. Let me know if I can help

Re: Additional Sorting and Pagination for licensing list
Posted: 10 January 2024, 13:49
by Jonathan2004
If you are a web developer there is always a workaround for manual sorting of the DOM.
I use this code in js console to manually sort the licenses by complexity :
Code: Select all
var compareFuncComplexity = function(a, b){
return a.children[6].textContent.trim() > b.children[6].textContent.trim() ? -1 : 1;
}
var container = document.querySelector("#by_game_table tbody");
var children = Array.prototype.slice.call(container.children);
var sortedChildren = children.sort(compareFuncComplexity);
sortedChildren.forEach(function(element) {
container.appendChild(element);
});