• Great plugin. Works wonderfully. I like to know if it’s possible to sort more than one column at a time, e.g. author then date? So far I see I can sort only one column at a time.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi Amy,

    you can do so by holding the <Shift> key pressed while clicking on the second column head.

    Best wishes,
    Tobias

    Thread Starter amyrogers

    (@amyrogers)

    Wow, that’s cool! Am I correct that I cannot make this a default setting at the back-end so when the page is first loaded it will sort the two columns? It’s already set to sort in one column, but I see no option to sort also another column at the same time.

    Thanks!

    Hi Amy,

    yes, you can make this the default setting in the backend.

    For this you will need to add a small piece of code to the “Custom Commands” textfield of the “DataTables JavaScript Features” section on the “Edit” screen of the table.

    This will look similar to this:

    "aaSorting": [ [0,'asc'], [1,'asc'] ]

    (In this case it will be the first to columns, based on a 0-index.)

    For more information on the detailed commands, please see
    https://datatables.net/examples/basic_init/multi_col_sort.html
    and the other examples of the DataTables documentation.

    Best wishes,
    Tobias

    Thread Starter amyrogers

    (@amyrogers)

    It works beautifully. Thanks!

    Thread Starter amyrogers

    (@amyrogers)

    Hi- For some reason the code I added

    "aaSorting": [ [1,'asc'], [2,'asc'] ]

    did not stick. In fact, when I went to check on it in the DataTables Javascript Features section, the above code was gone, or at least not visible in the Custom Commands field.

    Here’s a link to the table on the site. https://bit.ly/7AkhCi

    I want the Author be sorted first then the Date when the page is loaded.

    Any suggestions how to fix this?

    Thread Starter amyrogers

    (@amyrogers)

    (The link above takes you to a page that warns you that it may be a spammy site, but it’s actually a development area on a new host [for us].)

    Hi Amy,

    are you sure, you are working on the same table as before?
    Can you try to create a new one and test it there again?

    Regarding the link, there was nothing showing up there, just a placeholder page, telling me my IP address…

    Thanks!
    Tobias

    Thread Starter amyrogers

    (@amyrogers)

    HI Tobias,

    We moved it last night to it’s new permanent location at https://bit.ly/5rpOxw. Please check again.

    Amy

    Hi Amy,

    thanks for the updated link!

    I checked the source code of that page, but did not find the "aaSorting": [ [1,'asc'], [2,'asc'] ].

    Therefore I’m pretty sure that it is not added in the “Custom Commands” field of the DataTables features. Could you check that again?

    If it really is there, please contact me by email (is in the the imprint on my website).

    Thanks a lot!
    Tobias

    Thread Starter amyrogers

    (@amyrogers)

    Thanks, Tobias. I rentered the code and it’s working again, but my main concern was the code that I entered before disappeared for some reason. I wondered what caused it to go away?

    Also, I had "bAutoWidth": false in that same field before and that one disappeared as well. In the end I didn’t need it, so I did not think much of it until the same incident happened with the sorting code.

    Any suggestions will be appreciated.
    Amy

    Hi Amy,

    ok, thanks for the clarification. I had somehow missed that you said that before.
    I can’t really think of a reason, why the commands should suddenly disappear, and I was not able to reproduce that on my servers.

    I could imagine that it is related to a server issue, as discussed here:
    https://www.ads-software.com/support/topic/289836?replies=9
    There’s nothing I can do about that (and maybe not too much you can do) though.
    But to confirm this, I’d have to see the issue for myself.
    Could you get in touch by email (is in the the imprint on my website)?

    Thanks!
    Tobias

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: WP-Table Reloaded] Sort more than one column?’ is closed to new replies.