Need to make a table of information on a web page sortable
December 9, 2015 2:10 PM   Subscribe

I've got a web page of static content that I need to make sortable by multiple columns. Essentially, it's a calendar that has these columns: date, location, event. I need to put this information onto a simple, fast-loading web page in such a fashion that I can have a primary method of sorting and then also sort things in a secondary and/or tertiary way within those results.

Right now, the page I have will let me sort by dates or by location or by event. But once it has sorted for one of these criteria, the other information is disorganized.

I need to make it so that I can, for example, with a few clicks, sort with "Event Type" as the primary sort, but also sort within those results for "Location," keeping events in the same city together, still sorted by date.

Or, if I need to see only events of "Event Type B" happening in January, I could sort by date, then within those results, sort by event type, then by location.

I was a web developer back in the day and can probably futz my way through configuring a script in HTML, PHP, CGI, JavaScript, etc. if I only knew what to look for. But I am out of the loop enough that I cannot even figure out what the terminology is to even look online for this.

So, preferred kinds of answers, from best on down:
1) That's called "Foo." Here is a link to a script you can use that will let you dump in data and let you sort and sub-sort like that on a web page.
2) That's called "Foo." You might ask the nice people on "Bar" and they probably have ideas for the best way to do that.
3) I know an online app that lets you do that.
posted by DirtyOldTown to Technology (3 answers total) 1 user marked this as a favorite
 
https://datatables.net/examples/basic_init/multi_col_sort.html may be what you are looking for.
posted by isauteikisa at 2:12 PM on December 9, 2015 [1 favorite]


Here is a tutorial showing you how to implement this with Javascript (jQuery + Tablesorter plugin). This plugin refers to the "primary, then secondary" sorting you describe as "multi-sort". Not sure if that is a universal term, but it is supported out of the box (click to sort once, then shift-click the second column)
posted by misterbrandt at 2:51 PM on December 9, 2015


You really want to use Mottie's fork of the Tablesorter plugin. Mottie's tablesorter is actively developed, has a TON of nice features, and the original plugin stopped being developed years ago.
posted by cnc at 5:39 PM on December 9, 2015 [2 favorites]


« Older Taking a 6 month sabbatical. Travel insurance?...   |   My husband can't orgasm during sex, help me cope? Newer »
This thread is closed to new comments.