• Resolved Jason Ryan

    (@viablethought)


    Hello Tobias –

    Just had a quick question, is there a way to set a default sort order based on a numeric column? For instance, if I wanted an “Age” column to always sort ASC, showing the lowest age first and so on by default.

    Thanks in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Jason Ryan

    (@viablethought)

    Tobias –

    Disregard, I should’ve referred back to the DataTables site again, it is possible. I just have to add it to my code.

    But just to clarify, this isn’t TablePress out-of-the-box functionality correct?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Good to hear that you found the solution already! Indeed, this is all JS functionality from DataTables.

    Regards,
    Tobias

    I downloaded the extension (https://tablepress.org/extensions/table-row-order/) and donated a few dollars because I was so thrilled to have it (as I don’t know JS).
    Tell me, is there away to exclude rows from being sorted by column? I have some summation rows that I don’t want to be included in the sort. I’m working around it by sorting by a hidden row, but would like to simplify it if I can.

    Thanks.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I’m not really sure what you mean with “exclude rows from being sorted by column”. Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    On here: https://insideevs.com/december-2017-plugin-electric-vehicle-sales-report-card/
    I would like to sort the last column from most to least.
    But exclude the last 3 rows as those are total rows.
    Thank you in advance for your help.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ah, thanks for the link. I see what you mean now. Unfortunately, I’m not aware of a solution here. Excluding a row from sorting is only possible for the row marked as table footer row. It’s not possible to have multiple such rows, however, due to how tables work.

    Regards,
    Tobias

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Default Sort Order’ is closed to new replies.