Auto sorting currency column
-
Hi Tobias,
First I would like to thank you for a wonderful plugin that helps me a lot!
My goal is to auto sort the table on page load by a currency column.
I have no success doing that and after 2 days of reading all over documentation and this help forum I decided to open a ticket here.Using latest versions of all.
This is what I did, the table is here.
1. Getting a price with $ sign threw wp-scraper code. (I have messed up with its code and managed to make it “print” only a number with $ sign and no other html or tags)
2. Installed the datatables sorting plugin.
3. Added this to custom commands:
"aoColumnDefs": [ { "sType": "formatted-num", "aTargets": [ 1 ] } ]
(price column is B)No success, keep getting this error:
DataTables warning: table id=tablepress-haze – Requested unknown parameter ‘1’ for row 0. For more information about this error, please see https://datatables.net/tn/4
Also tried this version of code:
"columnDefs": [ { "type": "formatted-num", "targets": [ 1 ] } ]
giving me same error.4. Next step would be adding a auto sort on load code:
“aaSorting”: [[1,’desc’]]5. How do i combine both? (taking in consideration that currency detect is working fine..)
Thank you very much,
Yoav
- The topic ‘Auto sorting currency column’ is closed to new replies.