Tables no longer sortable

Issue #608 resolved
Tim de Wit
created an issue

E.g. on "display names & modality" page. Worked earlier but seems to be broken (0.8.0b1 release).

Comments (24)

  1. Ed McDonagh

    Thrown it onto testing, and it works nicely. Thanks.

    Now though, I'm thinking we should put a sortable custom key in to the how many studies column to sort on the date of the last item - that is something I have found myself wanting to sort by (within a single x-ray source) several times - mainly to see which version of software a scanner is on!

  2. David Platten

    The table shown to the user in the review_summary_list.html has two heading rows, the first contains:

    General; Patient module; CT data; DX/RF/MG; Accumulated data; Irradiation event data

    The second contains:

    Date; Time; General; Study; Template; Accumulated; Events; Template; Accumulated; Fluoro & DX; Mammography; Cassette based Projection; General; Detector; Source; Mechanical

    Because of these two header rows the sorting doesn't really work, so I'm going to remove it for this page.

  3. Ed McDonagh

    I think the sorttable.js is there at the top because I copied your page rather than because I was using it. The table itself doesn't have the sortable style.

    So I think it is just the script tag at the top that needs removing.

  4. David Platten

    Clicking on the How many studies column now sorts by the date of the most recent study in each row (as you asked for, Ed). I had trouble using the sorttable_customkey for this, so I've used a hidden div with the required date instead. Works fine. The only problem with this is that users will expect this column to be sorted by the number of studies, rather than by the date of the most recent study in each row. References issue #608

    → <<cset f59b6c994718>>

  5. Ed McDonagh

    Thanks David. I should have had a div with the ID in displayname-modality.html, then put a <td> in it which would be replaced by the AJAX <td>. The replacement td could then have the sorttable_customkey with {{ latest|date:"Ymd" }} and it should work in the same way that your solution does.

    Problem is, it doesn't work as I had envisaged! I had hoped I could end up with a table that was sorted by display name and within that sorted by last study, so I can see how what has changed over time (normally software versions). But when I sort by display name after sorting by study date the study date order isn't preserved.

    So.... I think the best solution would be as follows: revert your study date sort so it just sorts by number of studies as expected, then instead sort the rows in the view so it starts in the way I want, and they can be resorted by column header from there.

    Um, what do you think? Feel a little guilty for wasting your time...

  6. Ed McDonagh

    Finally realised that my request is impossible without further revamping of how this page works, which is definitely not something to be done this side of a release, if ever! Of course the latest date isn't available until after the table is rendered!

    I am going to push this onto testing and create a PR - I think this should be merged in now.

    Thanks David

  7. Log in to comment