Ready to get started?Download WordPress


[resolved] display sorting already pre-sorted (3 posts)

  1. mayte_eme
    Posted 9 months ago #

    i installed tablepress plus these 2 extensions:
    1. tablepress-datatables-sorting-plugins
    2. tablepress-table-row-order

    I have a table with 2 columns (A and B). Column A has names and column B has numbers that go from 0 to 999,999,999 (e.g. 1,256,145 or 256,254 or 456). i was to sort by column B by descending order.

    with " tablepress-datatables-sorting-plugins" extension i can enable sort ni the edit page and add this line for users to sort themselves: "aoColumnDefs": [ { "bSortable": false, "aTargets": [ 0 ] } ]

    it works but i really want to display the table in the page already sorted without users having to sort themselves. i installed "tablepress-table-row-order" extension and use [table id=1 row_order="sort" row_order_sort_column="B" row_order_sort_direction="DESC" /] in the actual page but no luck .. any help will be greatly appreciate it.



  2. mayte_eme
    Posted 9 months ago #

    never mind.

    guess got too confused and couldn't see it. i removed "tablepress-table-row-order" plugin. using shortcode[table id=1] to display the page and in tablepress edit page, using "aaSorting": [[ 1, "desc" ]] . that did it :)

  3. TobiasBg
    Plugin Author

    Posted 9 months ago #


    thanks for your post, and sorry for the trouble.

    Great find! Yes, the problem here is that the Row Order Extension can only work on real numeric data. As your cells contain a thousand separator in the numbers (the comma), this doesn't work. You'll need to use the JS-only approach with those "Custom Commands" that you have already found :-)

    Best wishes,

    P.S.: In case you haven't, please rate TablePress here in the plugin directory. Thanks!


You must log in to post.

About this Plugin

About this Topic