Post

2 followers Follow
2
Avatar

How to Create a Sorted Table on a Custom Page via HTML/JScript/CSS/Whatever?

I would like to sort the table below by User Name (or any other reasonably logical) field.  The below example comes from the Time Reporting Compliance app which has a pretty cool Custom Page, but requires sorting:

As is from the App Marketplace, the table is constructed via cycling through All Users and appending HTML formatted text into a text field.  The text field is subsequently dropped into the displaying HTML for presentation.   For reference, the code in reference from the original App: 

Table Construction: 

Presentation within page (note the second to last line where the variable is dropped in): 

The list appears to always order per chronological user creation (but that's only a guess).  

It is not unusual for us to have dozens of offending Timesheet users weekly and displaying these lists in a logical fashion would prove very helpful.

I can provide more information if helpful, but the actual App is here: https://www.clarizen.com/apps/time-reporting-compliance/

Matt Answered

Please sign in to leave a comment.

1 comment

2
Avatar

After several days of scouring the internet and an extensive trial and error, I developed a solution.  Maybe it will find its way into the App Marketplace solution: 

Step 1: update table header's style to be clickable

 

Step 2: add script to perform sort

 

Step 3: view end result

Step 3.b: click on header Name

Credit goes to: https://stackoverflow.com/questions/14267781/sorting-html-table-with-javascript

Matt 2 votes
Comment actions Permalink