Hi,
thanks for your post, and sorry for the trouble.
Unfortunately, you can not use the Table Row Order Extension with data that from dynamic sources, like Shortcodes. Your best chance is to use the JavaScript-based sorting. 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
Thanks Tobias,
https://www.lukasbydzovsky.com/test/
I want to order the rows based on the 24h vol.
In the last row are the (reversed) ranks I put in manually.
I want to pull the ranks also from a google sheet and then order the rows automatically 🙂
Hi,
thanks for the link! In order to be able to sort by that currency value, we’d need that to stand by itself in its own column (because the sorting algorithm can’t pick it up otherwise). Could you maybe add an extra/new column to the table where you only add that currency value (via that Shortcode)? We’ll then configure the sorting for that and hide the column again.
Regards,
Tobias
I have now added the values in the next column. I can’t find a way to order the rows by those values. The arrows do not work.
Sincerly,
Lukas
Hi Lukas,
great! Now please
– turn on the “Use DataTables” and “Sorting” checkboxes on the table’s “Edit” screen (to other features can be turned off if you don’t want them).
– Add this to the “Custom Commands” text field on the table’s “Edit” screen:
"columnDefs": [ { "orderable": false, "targets": [ 0, 1, 2, 3 ] }, { "visible": false, "targets": [ 3 ] }, { "orderData": [ 3 ], "targets": [ 2 ] } ], "order": [
[ 2, "desc" ] ]
Regards,
Tobias
Thank you very much!
This works but
– I dont want to display a table header row and enable sorting by visitors.
– it now shows only the values while hiding the currency value (which I want to be displayed)
Any way how to remove it? Do you accept bitcoin for donation?
regards,
lukas
-
This reply was modified 7 years, 1 month ago by
onetime1a.
Hi,
ah, my code has a small bug. Please try again with
"columnDefs": [ { "orderable": false, "targets": [ 0, 1, 2, 3, 4, 5 ] }, { "visible": false, "targets": [ 5 ] }, { "orderData": [ 5 ], "targets": [ 3 ] } ], "order": [ [ 3, "desc" ] ]
In addition, please add a new (empty) first row to your table.
Then, please also add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:
.tablepress-id-11 thead {
display: none;
}
Regards,
Tobias
thank you for taking the time – everything works, just sent some BTC.
https://btc.com/fded4587b544ae5e88e06c155cfe8736d6cc8fe40c3e89c2198fffa3a466d4b0
coffee is on me 😎
Sincerely,
lukas
-
This reply was modified 7 years, 1 month ago by
onetime1a.
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
And thanks for the coffee, I really appreciate it!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!
sry, I thought it worked, but it doesn’t.
I applied all the commands and checkmarked “data tables” and “sorting”
Any idea ?
"columnDefs": [ { "orderable": false, "targets": [ 0, 1, 2, 3, 4, 5 ] }, { "visible": false, "targets": [ 5 ] }, { "orderData": [ 5 ], "targets": [ 3 ] } ], "order": [ [ 3, "desc" ] ]
[ 2, "desc" ] ]
There are 6 columns and 9 rows.
Hi,
okay, another try:
"columnDefs": [ { "orderable": false, "targets": [ 0, 1, 2, 3, 4 ] }, { "visible": false, "targets": [ 4 ] }, { "orderData": [ 4 ], "targets": [ 3 ] } ], "order": [ [ 3, "desc" ] ]
Regards,
Tobias
nope 😀 I have applied it, but look yourself.
I guess its because of it cant grab data from a shortcode ? 🙁
regards,
Lukas
Hi,
please check the “Custom Commands” field again, it seems that you have a line break in the code now, so that some code is in there twice. (You can drag the field bigger in the lower right corner.)
Regards,
Tobias
Hi,
Good to hear that it’s working now! 🙂
Best wishes,
Tobias