TW5 Sortable Tables seem not working

here is the link to old [tw5] Re: TW5 Sortable Tables

i try to use this to make a light weight sort for may simple tables in tiddlywiki. but seem the sort acting very strange under the new js code.
i download the code from (https://github.com/tofsjonas/sortable/blob/main/dist/sortable.js)

Make sure your table headers are formatted as headers.

I use a modified version of sortable v3.2.3 to sort numbers with commas, % and K suffix.

Modified Sortable
SortableCSS

Example tables

1 Like

wow, shocked me … and thanks very much!

so , are you modify that sortable.js? which means with out modification , can’t simple copypaste, correct? i don’t know Java at all.

and also , what are those example tables? automated generated from survey data, using python?

You can drag and drop the Modified Sortable and SortableCSS to an empty wiki and it should work just fine.

My modifications are to line 88 & 89, to get it to sort properly for numbers lie: 1,234,567 and 42% or 1,234K.

                var x = x.replace(/,|%|K/g, "");
                var y = y.replace(/,|%|K/g, "");

You are spot on, the example tables are my attempt to summarize the Tiddlywiki info data from the survey. I needed a python challenge that I had interest in, to stop me from thinking about a different python problem that was giving me fits.

thanks again… !

i saw there is a python tidder in it. how does it works? python works directly inside Tiddlywiki to generate table and charts?

It doesn’t work inside a standalone TW5, I just put it there to document the journey. You could copythe text to a .py file and run it against the data. I just cut and pasted the specific column of the survey spreadsheet to a text file survey_responses.txt.