Self Sorting Tables

ChainsawXIV
ChainsawXIV
edited October 2009 in Feature Requests

Comments

  • ChainsawXIV
    ChainsawXIV
    Posts: 530 edited December 2009
    I'd like the ability to have tables where the user can click the column headers to sort the table by each column. While this may sound complex, it's actually pretty simple to accomplish using a little Java Script.

    "This example":http://omnichron.net/external/op/dhtml_examples.html I created defines what this would look like, and demonstrates it in use. The functionality is automatically applied to each table as long as it has a header row, just by running a simple function on page load.

    Implementing this feature is as simple as adding the two functions there into your existing java script files, and calling the setup function on load.
    Post edited by ChainsawXIV on
  • thrydwolf
    thrydwolf
    Posts: 1
    I really like your idea Chainsaw. Did you get any response from the Devs?
  • ChainsawXIV
    ChainsawXIV
    Posts: 530
    None that I know of.
  • Taloff
    Taloff
    Posts: 14
    I've passed this along. Thanks for the suggestion.
  • Micah
    Micah
    Posts: 894
    Hey, just saw this...

    It's not a bad idea, and like you say, not too hard to implement. Heck, there may already be a jQuery plugin that does exactly this, meaning we end up writing 0 lines of code. Always a good thing :)

    I essentially have 2 concerns:

    1) My main concern is that of course some people are going to want it and some won't. So, it has to be configurable in some sense. We could do it by only applying the javascript to tables with a special class (say, "self-sorting"). Not a big deal.

    2) It's one of those things that only maybe 0.01% of people will use. Some of these features are cool, and I like supporting them, but it always makes me a little sad to know I'm writing something that so few will ever use. The solution here is that if we program it, then you guys need to use and evangelize it. If anyone comments, "Hey, that's cool!" then please tell them how you did it and how they can do it in their own stuff.

    I'll find a spot for it on the TODO list. It should only take about an hour. So, if I have a little downtime, I'll see if I can stuff it in.
  • gnunn
    gnunn
    Posts: 423
    If you do this, I will TOTALLY use it! especially for my party's loot tables. I currently keep an Excel spreadsheet that allows me to sort by who is carrying what, or which items need to be Identified and I try to include tables on a session by session basis on the site. If I could have something on here with sorting capability, I could quickly set up a master loot page and perhaps a "how much crap is in our bag of holding?" page without having to hand sort the ordering.
  • ChainsawXIV
    ChainsawXIV
    Posts: 530
    For what it's worth, since the forum view for campaigns ("example":http://www.obsidianportal.com/campaigns/sanction/forum) is set up in a table with a table header row, this would also make it possible to sort the forums by the various columns, which is always nice.

    If jQuery doesn't have what you need already built in, you can feel free to snag the code I wrote for the example linked above.
Sign In or Register to comment.

August 2022
In Over Their Heads

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions