• Resolved drumlerry

    (@drumlerry)


    I’ve installed wp table reloaded and want to know if it is possible to random sort a column containing text. I’ve got a column with text and I can sort it alphabetically. If there are 30 rows, those in the middle (alphabetically) never appear at the top. Is a random sort based on text possible?

    Regards
    Brian

    http://wordpress.org/extend/plugins/wp-table-reloaded/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi Brian,

    thanks for your question.

    Unfortunately, I’m not aware of an existing random sort solution. It could probably be done with a custom sorting algorithm that extends the DataTables JavaScript library (which does the sorting), but I don’t know how that would have to look like 🙁

    Regards,
    Tobias

    Thread Starter drumlerry

    (@drumlerry)

    Thanks Tobias for coming back so quickly – yes, I realise that “random” is not part of wp-table reloaded but I just thought I’d ask. I’m building a site for holiday homes in Ireland and owners like to see their home at top of listings occassionaly. With alphabetical sort, the middle ones stay in the middle.

    Thanks again
    Brian

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Brian,

    ha, funny, I just remembered that I had developed some code to bring a table into random order (whenever the page is loaded, so this does not even need to change the sorting) a year ago, thanks to another post here in the forums.

    You can find everything here:
    http://wordpress.org/support/topic/plugin-wp-table-reloaded-random-row-option

    Just make sure that you use last chunk of code that I posted in that thread, as the first one contains a bug (which you will however notice if you read the entire thread).

    Additionally (this was not yet necessary when the thread was created a year ago), please disable the “Cache Table Output” checkbox on the “Edit” screen of the table, as this will not work otherwise.

    Regards,
    Tobias

    Thread Starter drumlerry

    (@drumlerry)

    Hello Tobias

    Thanks for this – I’ll try it this evening and let you know how I get on

    Brian

    Thread Starter drumlerry

    (@drumlerry)

    Hi Tobias

    Works great – table now appears in random order on load. That should keep advertisers happy. Have made a donation via PayPal

    Keep up the good work

    Brian

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Brian,

    very cool! 🙂 Nice that this worked!

    And thank you very much for your donation, that’s really nice of you!

    Best wishes,
    Tobias

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘wp-table-reloaded – random sort order’ is closed to new replies.