mercredi 5 février 2020

Randomize JSON file for use in Bootstrap Table when using data-url

I have created a sort of Database table showing specific pages using an element on the SCP-Wiki which you can see here:

http://www.scp-wiki.net/anomaly-classification-system-guide#toc3

And here is a direct link to the HTML file in the iframe:

http://elusionillusion.com/scp/acs-database/acs-database.html

The SCP-Wiki uses Wikidot which is, alone, a giant pain... but either way, I've gotten it to work for the most part with one exception: I would like to randomize the rows each time the table is loaded.

The issue I am having is that I have to do it before the table is drawn by Bootstrap. I tried using javascript to randomize the rows after the table is drawn but it broke all the sorting functionalities. Here's a link to an example showing this: http://elusionillusion.com/scp/acs-database/acs-database-test.html

As of right now, the table uses data-url="http://elusionillusion.com/scp/acs-database/acs-database.json"> to pull the JSON file to create the table. I am not sure how to randomize this JSON file prior to the table pulling it.

Any help would be greatly appreciated!




Aucun commentaire:

Enregistrer un commentaire