Additional Sorting and Pagination for licensing list

Game development with Board Game Arena Studio
Post Reply
Andrew Bowns
Posts: 1
Joined: 10 January 2024, 04:32

Additional Sorting and Pagination for licensing list

Post 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 :)
User avatar
Jonathan2004
Posts: 46
Joined: 21 April 2020, 19:06

Re: Additional Sorting and Pagination for licensing list

Post 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);
    });
Post Reply

Return to “Developers”