WordPress.org

Forums

TablePress
[resolved] sorting multiple columns (4 posts)

  1. llywlearning
    Member
    Posted 9 months ago #

    Hi
    Great plugin. We're using it for a league of school rugby teams.
    However, there are two problems that I am trying to solve:

    1) Identifying the CSS code to sort by multiple columns e.g. sort by 'total points' column, followed by 'points scored difference' column. That way, two teams with the same total points will then be sorted according to their points scored difference.

    2) Adding code that will combine the totals of two cells e.g. column A - column B = column C

    Thanks so much for your help.

    Llywelyn

    https://wordpress.org/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

    thanks for your question, and sorry for the trouble.

    1) Sorting is not done with CSS, but with JavaScript (JS) code. The question here is: Which sorting are you refering to? That sorting that a user can do when he views the table? Or the sorting on the "Edit" screen of the table?

    2) For that, you can use math formulas in the table cells, see http://tablepress.org/tablepress-features-formulas/ for some examples.

    Regards,
    Tobias

  3. llywlearning
    Member
    Posted 9 months ago #

    Thanks for the prompt reply Tobias.
    I would like to sort from the editing page. All sorting will be disabled for users.

    I shall follow the advice from your link. Thank you.

  4. TobiasBg
    Member
    Plugin Author

    Posted 9 months ago #

    Hi,

    thanks for the explanation! An automatic sorting on the "Edit" page for two columns is not possible at the moment, unfortunately.
    I can therefore only suggest to sort for the primary criterion (total points) there, and then manually use the drag and drop feature (via the row numbers on the left of each row) to switch those rows where the points difference requires it.
    An alternative would be to maintain the table in Excel, do the multi-column sorting there and then re-import the table into TablePress, choosing to replace the existing table.

    Regards,
    Tobias

Reply

You must log in to post.

About this Plugin

  • TablePress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.